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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
'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
|
|||
|
|||
'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
|
|||
|
|||
'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
|
|||
|
|||
'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 | |
|
|