Object Required

  • Thread starter Thread starter Stefan
  • Start date Start date
S

Stefan

I get Object Required error message

I have a command button with this code

Dim stDocName As String
stDocName = "rpt Average # Patient Visits"

If Me![FromDate] Is Null Then

DoCmd.OpenReport stDocName, acPreview
End If


FromDate(is causing the error) is an unbound field on the
form which I am using to filter.

I have tried to go to tools references to make sure I have
the right object libary selected.

Any Ideas

Thanks in advance
 
Change
If Me![FromDate] Is Null Then

to
If IsNull(Me![FromDate]) Then

You need to use the IsNull function for your situation.
 
Back
Top