Hello I created a Macro to use to open a form with certain parameters but it is not working after being converted to vba and yes event procedure is selected for the event.
Private Sub Enter_Click()
On Error GoTo Enter_Click_Err
DoCmd.SetParameter "StartDate", StartDate
DoCmd.SetParameter "EndDate", EndDate
DoCmd.OpenReport "ActivityCde", acViewReport, "", "", acNormal
Enter_Click_Exit:
Exit Sub
Enter_Click_Err:
MsgBox Error$
Resume Enter_Click_Exit
End Sub