Code calling the form. This form shows various data depending on what is passed in, Weekly, Monthly etc.
Code:
Private Sub cmdMonthly_Click()
DoCmd.OpenForm "frmPeriod", , , , , acDialog, "Monthly"
'Forms!frmPeriod.ConfigureForm ptMonthly
End Sub
Then Form Load
Code:
Private Sub Form_Load()
' Add which period we are showing to form title label
If Not IsNull(Me.OpenArgs) Then
Me.lblTitle.Caption = Me.lblTitle.Caption & Me.OpenArgs
Me.RecordSource = "qry" & Me.OpenArgs
End If
DoCmd.GoToRecord acDataForm, Me.Name, acLast
End Sub