macro and code in the same event

N

neeraj

I have a report for which I had a macro, say Macro1 written into its 'On
Open' property. Later I realized that I wanted to have the report opened
maximized. Not knowing how to do that in a macro, I added a code in the
Report Open event in the VBA window as docmd.maximize. But when the report
opens, it doesn't open maximized though Macro1 functions properly. Is there
an equivalent for this code command in a macro. Can a macro and code be
written in the same event. How can I achieve both these tasks?
 
D

Douglas J. Steele

You have to choose one or the other (although a macro can call a VBA
function, or VBA code can call a macro)

Actually, you're best off putting all of your tasks in the VBA code. Macros
may be quick to implement, but they have the downside of not allowing error
trapping, plus you can't document what you're doing as easily as you can by
having comments in VBA.

In any case, macros have a Maximize action available in them.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top