Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Running Macro form Code

Status
Not open for further replies.

EddyLLC

Technical User
Mar 15, 2005
304
US
Is it possible and/desirable to run a macro to open a new form and close the current form from code behind a form? I have a button on a form that will close it after running some edit code. Can I just somehow reference the macro after the code? I tried just putting the name of the macro in the code but got a invalid Sub or Function error?

Thanks
 
You may consider the DoCmd.RunMacro method.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
eg:

stDocNameExit = "Exit1"
DoCmd.RunMacro stDocNameExit

Where Exit1 is the macro

Never give up never give in.

There are no short cuts to anything worth doing :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top