Dealing with 'non-existent' data

Tim L

Registered User.
Local time
Today, 08:30
Joined
Sep 6, 2002
Messages
414
I'm trying to copy data from a number of fields on a form to pass to another form. I store the data in suitable variables when the part of the form is clicked and then pass them to the second form. This all works fine unless one of the fields is blank, at which point I'm warned about "invalid use of Null".

I've tried testing for null with IS NULL and IS NOT NULL but get "improper" errors.

How can I check for fields with NULL values if these don't work??

What other method could I use to 'take' the values, so that I can either manipulate them or pass them to another form?

Tim
 
You cannot set String Variables to NULL. Use the Nz Function (Null-To-Zero). This will allow you to set a string to a value that is valid. If NULL needs to be a valid variable value then you need to use a different Variable Type.
 
Tim,

Code:
If IsNull(SomeField) Then
   MsgBox("It's Null")
End If

or ...

If Nz(SomeField, "") = "" Then
   MsgBox("It's Null")
End If

Wayne
 
Wayne and Travis, thank you both for your replies.

Tim
 

Users who are viewing this thread

Back
Top Bottom