is null error: object required

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have the above expression.
If Me.DocID Is Not Null Then

It gives me an error: Object required.

Does anyone know what does it mean?
 
Me. refers to the current form or report. If this code is not in a form or
report, you will have to change Me. to explicitly reference the form or
report you want.

DocID is not a property or method of a form or report. How have you defined
DocId?
 
Try:
If IsNull(Me.DocID) Then

The Is Not Null syntax works in a query, but not in VBA code.

(The Is operator in VBA is used for comparing objects, so that's what the
cryptic error message meant.)
 
Thank you for your reply.
Is there a is not null?
like: If IsNotNull(Me.DocID) Then

"Allen Browne" escreveu:
 
Thank you Allen,

In VBA Code the options are isnull() and isnotnull()?

"Allen Browne" escreveu:
 
No. You use:
IsNull()
or
Not IsNull()

There is no function called IsNotNull().
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top