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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Run macro in code from cmd btn

Status
Not open for further replies.

DrewConn

Programmer
Joined
Jan 8, 2002
Messages
167
Location
US
I have a command button that will run a report selected from a list box. I use the DoCmd.OpenReport Me.lstReports, IIf(Me.chkPreview.Value, acViewNormal, acViewPreview) to do this.

However, I also have macros in this list box and I don't know how to fire off a mcro using code in the same click event.

Any idea's?

 
Hi DrewConn,

Use ..

Code:
[blue]DoCmd.RunMacro [i]YourMacro[/i][/blue]

.. before (or after) the OpenReport.

Enjoy,
Tony

--------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading this: Before you ask a question.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top