A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

'firing' a Button!



 
 
Thread Tools Display Modes
  #1  
Old October 9th, 2006, 11:11 PM posted to microsoft.public.access.gettingstarted
Soddy
external usenet poster
 
Posts: 26
Default 'firing' a Button!

Hello!

I use to know how to do this, but I have forgotten!! I have an event
procedure on a form for a textbox (txtBox_GetFocus). When this control 'gets
the focus' (in the txtBox_GetFocus event), I want it to 'fire' a Button
(cmdButtonOne) on the same form to to something. Something similar to this:

Sub txtBox_GetFocus()
Me![cmdButtonOne].Click ! Of course, this doesn't work - need HELP!
End Sub

--
Thanks!
Soddy
  #2  
Old October 9th, 2006, 11:40 PM posted to microsoft.public.access.gettingstarted
Ken Sheridan
external usenet poster
 
Posts: 3,433
Default 'firing' a Button!



"Soddy" wrote:

Hello!

I use to know how to do this, but I have forgotten!! I have an event
procedure on a form for a textbox (txtBox_GetFocus). When this control 'gets
the focus' (in the txtBox_GetFocus event), I want it to 'fire' a Button
(cmdButtonOne) on the same form to to something. Something similar to this:

Sub txtBox_GetFocus()
Me![cmdButtonOne].Click ! Of course, this doesn't work - need HELP!
End Sub

--
Thanks!
Soddy

  #3  
Old October 9th, 2006, 11:43 PM posted to microsoft.public.access.gettingstarted
Jeff Boyce
external usenet poster
 
Posts: 8,621
Default 'firing' a Button!

Soddy

Try something like:

Call cmdButtonOne_Click()

Regards

Jeff Boyce
Microsoft Office/Access MVP

"Soddy" wrote in message
...
Hello!

I use to know how to do this, but I have forgotten!! I have an event
procedure on a form for a textbox (txtBox_GetFocus). When this control
'gets
the focus' (in the txtBox_GetFocus event), I want it to 'fire' a Button
(cmdButtonOne) on the same form to to something. Something similar to
this:

Sub txtBox_GetFocus()
Me![cmdButtonOne].Click ! Of course, this doesn't work - need HELP!
End Sub

--
Thanks!
Soddy



  #4  
Old October 9th, 2006, 11:48 PM posted to microsoft.public.access.gettingstarted
Ken Sheridan
external usenet poster
 
Posts: 3,433
Default 'firing' a Button!

Assuming the button's On Click event property is an event procedure call the
procedu

Sub txtBox_GetFocus()

cmdButtonOne_Click

End Sub

If it’s a macro then you'd run the macro with the RunMacro method of the
DoCmd object:

DoCmd.RunMacro "YourMacro"

If it’s a function you'd call the function:

Dim retVal

retVal= YourFunction()

Ken Sheridan
Stafford, England

"Soddy" wrote:

Hello!

I use to know how to do this, but I have forgotten!! I have an event
procedure on a form for a textbox (txtBox_GetFocus). When this control 'gets
the focus' (in the txtBox_GetFocus event), I want it to 'fire' a Button
(cmdButtonOne) on the same form to to something. Something similar to this:

Sub txtBox_GetFocus()
Me![cmdButtonOne].Click ! Of course, this doesn't work - need HELP!
End Sub

--
Thanks!
Soddy


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 12:46 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.