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

converted marcos - how do you use them?

Status
Not open for further replies.

pduncan

IS-IT--Management
Jun 20, 2003
203
US
I had some rather long marcos that run a series of queries, then opens a report based on the queries. I used the built in "convert marco to VB" feature, and it saved the VB code as a module. I would like to put this code behind a command button (on click() ) is there an easy way to have a command button call a module? I could cut and paste the code from the module, but thought that would be "cheating" - any suggestions?

PDUNCAN - MEMPHIS, TN

When I die, I want to die like my grandfather-- who died peacefully in
his sleep. Not screaming like all the passengers in his car.
 
If your converted macro is a function ie
Function MyConvertedMacro()
Then you can set the event PROPERTY to
=MyConvertedMacro()
If the converted macro is a sub, then open the Event Procedure for the event and enter:
MyConvertedMacro

Duane
MS Access MVP
 
it creates a new Module named concerted Macro.

PDUNCAN - MEMPHIS, TN

When I die, I want to die like my grandfather-- who died peacefully in
his sleep. Not screaming like all the passengers in his car.
 
Within the module, you will find either functions or subs like:
Public Function MyConvertedMacro()
or
Public Sub MyConvertedMacro
This is the code that actually gets called as I mentioned previously.

Duane
MS Access MVP
 
OK - sorry, didnt understand. I see what you meant now. Thanks A lot!

PDUNCAN - MEMPHIS, TN

When I die, I want to die like my grandfather-- who died peacefully in
his sleep. Not screaming like all the passengers in his car.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top