R
Rogers Fei
Hi, all
I'm trying to automate an Access Application. I can access the "Forms"
and "Reports", but I do not have a good and efficient way to access the
controls.
e.g. I want to click a button or raise a click event on a specified button
on a "Form" after it is opened. Currently, I just use the following codes:
DoCmd.GoToControl MyForm.Controls("MyControl") //Focus the button control
SendKeys " ",true //Press space key to fire a click event on this
button
I'm not very satisfied with the preceding code because it is not stable.
Could anybody tell me whether there's a better to do this? Or can I invoke
the event handler function (private sub CmdButton_Click....) from outside?
Thank you very much!
I'm trying to automate an Access Application. I can access the "Forms"
and "Reports", but I do not have a good and efficient way to access the
controls.
e.g. I want to click a button or raise a click event on a specified button
on a "Form" after it is opened. Currently, I just use the following codes:
DoCmd.GoToControl MyForm.Controls("MyControl") //Focus the button control
SendKeys " ",true //Press space key to fire a click event on this
button
I'm not very satisfied with the preceding code because it is not stable.
Could anybody tell me whether there's a better to do this? Or can I invoke
the event handler function (private sub CmdButton_Click....) from outside?
Thank you very much!