Force a command button to click

G

Gina

Does anyone know how to force a command button to click.

ie: I want when the user click the tabpage for a command button to click
thereby forcing the On_Click event, this way no one has to remember to click
it. I can then make this button invisible. I can SetFocus but I can't
force the On_Click event to occur.

Thanks for ANY help!
 
R

Rick Brandt

Gina said:
Does anyone know how to force a command button to click.

ie: I want when the user click the tabpage for a command button to click
thereby forcing the On_Click event, this way no one has to remember to click
it. I can then make this button invisible. I can SetFocus but I can't
force the On_Click event to occur.

The forest is blocking the trees. :)

Move the code from the button's click event to the Change event of the TabControl.
All you have to do is add a line to test for the proper TabPage.

If Me!NameOfTabControl.Value = 2 Then '(third page example)
copy button code here
End If
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top