K
kev.thorpe
Hi,
I am trying to filter a report using a form's filter, following
instructions I found on the internet. I am however running into
compile error: end if without block if.
The code as it appears in my database is:
Private Sub cmdOpenReport_Click()
If Me.Filter = "" Then
MsgBox "Apply a filter to the form first."
Else
DoCmd.OpenReport "rptCustomers", acViewPreview, , Me.Filter
End If
End Sub
and here is the code from the internet
Private Sub cmdOpenReport_Click()
If Me.Filter = "" Then
MsgBox "Apply a filter to the form first."
Else
DoCmd.OpenReport "rptCustomers", acViewPreview, , Me.Filter
End If
End Sub
What am I missing???
I am trying to filter a report using a form's filter, following
instructions I found on the internet. I am however running into
compile error: end if without block if.
The code as it appears in my database is:
Private Sub cmdOpenReport_Click()
If Me.Filter = "" Then
MsgBox "Apply a filter to the form first."
Else
DoCmd.OpenReport "rptCustomers", acViewPreview, , Me.Filter
End If
End Sub
and here is the code from the internet
Private Sub cmdOpenReport_Click()
If Me.Filter = "" Then
MsgBox "Apply a filter to the form first."
Else
DoCmd.OpenReport "rptCustomers", acViewPreview, , Me.Filter
End If
End Sub
What am I missing???