You have a couple of choices to accomplish this. The first, and probably easiest is to use the Macro to VBA converter. The following was taken directly from the Microsoft Visual Basic Editor Help.
Convert macros on a form or report to Visual Basic
Open the form or report in form or report Design view.
Point to Macro on the Tools menu, and then click Convert Form's Macros To Visual Basic or Convert Report's Macros To Visual Basic.
To create the code yourself, use the DoCmd object's RunCommand method with one of the following constants:
- acCmdFitToWindow
- acCmdZoom10
- acCmdZoom100
- acCmdZoom150
- acCmdZoom200
- acCmdZoom25
- acCmdZoom50
- acCmdZoom75
- acCmdZoomBox
- acCmdZoomSelection
Your code would be similar to the following:
Code:
Private Sub Report_Open(Cancel As Integer)
DoCmd.RunCommand acCmdFitToWindow
End Sub
Hope this helps.