Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / March 2007

Tip: Looking for answers? Try searching our database.

open a form and run command button code

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
alfaista - 14 Mar 2007 18:08 GMT
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!!
Bob L. - 14 Mar 2007 19:03 GMT
> okay, i know this sounds a bit whacky, but i am working around someone else's
> code, and have a very quick deadline.
[quoted text clipped - 8 lines]
>
> 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.
alfaista - 14 Mar 2007 19:16 GMT
thank you thank you!!
forgot all about sendkeys!!  works perfect, and fast!  thanks!

> > okay, i know this sounds a bit whacky, but i am working around someone else's
> > code, and have a very quick deadline.
[quoted text clipped - 18 lines]
> HTH,
> Bob L.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.