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

SAME MACRO, MULTIPLE FORMS? 1

Status
Not open for further replies.

Odis

Technical User
Jan 25, 2001
78
US
I have a Macro that I am using on several Forms. It does the same thing, but the form name is different. What command do I replace the Form Name with to have it reflect the current active form?

Thanks
 
I don't think you can do this in a macro.
You would need to convert your macro to code and then you could use the screen.activeform object.
 
I could have sworn I saw it done in a macro somewhere. I am not good with code, so I was hoping for the macro. THANKS
 
Like most Access developers, I stay away from Macros. I'm not at an Access loaded machine right now, so I can't check this, but I wonder if something like this might work. Declare a Public Variable, say strCurrentForm. In the Form_Load sub for each form enter the line:

strCurrentForm = "YourCurrentFormName"

Substitute the actual name for the YourCurrentFormName.

Then in your macro under the Action Arguements where it asks for the form name, enter strCurrentForm.

Don't know if it'll work but it's worth a try!

The Missinglinq

There's ALWAYS more than one way to skin a cat!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top