open a form and run command button code

A

alfaista

okay, i know this sounds a bit whacky, but i am working around someone else's
code, and have a very quick deadline.

what i need to know, is there a way to open a form and run the code that it
has behind a command button, from another form?

i have a main form, that shows a basic view. some buttons on this form need
to open the much more detailed form, and excute code within that form as if
one of those buttons were clicked. in other words, open form, run
commandbutton_click() code.

thanks in advance for any assistance!!
 
B

Bob L.

* alfaista said:
okay, i know this sounds a bit whacky, but i am working around someone else's
code, and have a very quick deadline.

what i need to know, is there a way to open a form and run the code that it
has behind a command button, from another form?

i have a main form, that shows a basic view. some buttons on this form need
to open the much more detailed form, and excute code within that form as if
one of those buttons were clicked. in other words, open form, run
commandbutton_click() code.

thanks in advance for any assistance!!

I was able to open a form called frmEmployees and push a command button
(cmdNext) on that form successfully using the following code:

DoCmd.OpenForm "frmEmployees"
Forms("frmEmployees").Controls("cmdNext").SetFocus
SendKeys "{ENTER}", True


HTH,
Bob L.
 
A

alfaista

thank you thank you!!
forgot all about sendkeys!! works perfect, and fast! thanks!
 
Top