Null values in strings

S

Steve

Cna someone tell me what I'm doing wrong - I'm developing a database in
Access 97 (mandated by client). I oick up a series of string variables from
a table and put them into a form for editing. It is possible for the
operator to delete an entry by blocking it and pressing delete. I need to
know when the field has been cleared completely like this. looking at the
debug, I find that a field, cleared in this manner, results in Null rather
than "". It then seems that using a statement such as
If Me.Field.Value = Null Then
code
doesn't actually resolve - the field value is Null but the If statement
doesn't pick it up (recognise the statement as true)
So how do I test for the Null value in the string?
 
D

Douglas J Steele

Nulls are a special case: Null is "unknown", so Null does not equal Null.
Use:

If IsNull(Me.Field.Value) Then
 
S

Steve

Perfect Doug, works a dream, many thanks

Steve

Douglas J Steele said:
Nulls are a special case: Null is "unknown", so Null does not equal Null.
Use:

If IsNull(Me.Field.Value) Then
 

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

Top