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:
Your code would be similar to the following:
Private Sub Report_Open(Cancel As Integer)
Hope this helps.