Click command button by VBA

BBBryan

Registered User.
Local time
Yesterday, 22:07
Joined
Nov 13, 2010
Messages
122
Hi,
I am trying to call a command button on a form to click it from code. I have this but it is giving an error
CallForms![Delete Data from Tables fm].BackUpDatabase_Click

Run time error 424
Object required.


My form is called Delete Data from Tables fm
and the command button is called BackUpDatabase


Thanks BBryan
 
Try:
Call Forms("[Delete Data from Tables fm]").BackUpDatabase_Click.

But the Click event of BackUpDatabase must be daclared as Public not Private and the form must be open.
 
Thanks Bob that worked.


BBryan
 

Users who are viewing this thread

Back
Top Bottom