compile error

  • Thread starter Thread starter kev.thorpe
  • Start date Start date
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 ran the code and it compiles just fine and runs just fine. Do you
get the compile error just when you click or are you compiling the
entire database when you get the error? The error has to be somewhere
else.
 
Back
Top