macro and code in the same event

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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.
 
Back
Top