Article ID: 145591
Article Last Modified on 1/19/2007
Name: cmdOpenReport
Caption: Open Report
OnClick: [Event Procedure]
Private Sub cmdOpenReport_Click()
If Me.Filter = "" Then
MsgBox "Apply a filter to the form first"
Else
DoCmd.OpenReport "rptCustomers", A_PREVIEW, , Me.Filter
End If
End Sub
Name: cmdClearFilter
Caption: Clear Filter
OnClick: [Event Procedure]
Private Sub cmdClearFilter_Click()
Me.Filter = ""
End Sub
Name: cmdClose
Caption: Close
OnClick: [Event Procedure]
Private Sub cmdClose_Click()
DoCmd.Close acForm, Me.Form.Name
End Sub
OnOpen: [Event Procedure]
OnClose: [Event Procedure]
Private Sub Form_Open(Cancel as Integer)
Me.Filter = ""
End Sub
Set the form's OnClose [Event Procedure] as follows:
Private Sub Form_Close()
DoCmd.Close acReport, "rptCustomers"
End Sub
Keywords: kbfaq kbhowto KB145591