Hello.
I am trying to simulate a mouse-click of a cmdbutton on another form, or call the Click event of a cmdbutton on another form.
From Form1, I want to "click" a cmdbutton which is located on another form.
Here's what I have so far:
Form1 is Open. A cmdbutton on Form1 has the following code:
DoCmd.OpenForm "Form2"
Forms!Form2.Form!mycmndbtn.SetFocus
Call Forms.Form2.mycmndbtn_Click
DoCmd.Close acForm, "Form1"
Access Error: "Application-defined or object-defined error"
Debug shows error is pointing to this line in the code:
Call Forms.Form2.mycmndbtn_Click
Any help is appreciated.
Thank you kindly,
Jamie.
I am trying to simulate a mouse-click of a cmdbutton on another form, or call the Click event of a cmdbutton on another form.
From Form1, I want to "click" a cmdbutton which is located on another form.
Here's what I have so far:
Form1 is Open. A cmdbutton on Form1 has the following code:
DoCmd.OpenForm "Form2"
Forms!Form2.Form!mycmndbtn.SetFocus
Call Forms.Form2.mycmndbtn_Click
DoCmd.Close acForm, "Form1"
Access Error: "Application-defined or object-defined error"
Debug shows error is pointing to this line in the code:
Call Forms.Form2.mycmndbtn_Click
Any help is appreciated.
Thank you kindly,
Jamie.