By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,998 Members | 2,921 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,998 IT Pros & Developers. It's quick & easy.

'IsNull([Field])' test ignored in code

P: n/a
I have an Access2K table in which several records have nulls in some
fields. In code that iterates through this table the statement

If Not IsNull([Field]) Then ...

(or If IsNull([Field]) Then ...)

is ignored when nulls are encountered in the field(s) in question. I
have verified that these fields are in fact null (not empty strings).

Does anybody know what's going on here?

Thanks
Dave
Nov 13 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
Identify one of the fields in one record that displays this behavior.
Open a recordset that returns this record, and ask Access what's there,
e.g.:
Debug.Print Len(rs!MyField), Len(rs!MyField)

If you are certain the value is not Null, and not a zero-length string,
perhaps it is just spaces or null chars. That should not happen through the
interface, but can happen when values are assigned programmatically.

You may also want to check that you have both Service Pack 3 for Office
2000, and Service Pack 8 for JET 4.

Please post back your results when you identify what is there.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Dave" <dg*****@erols.com> wrote in message
news:8d**************************@posting.google.c om...
I have an Access2K table in which several records have nulls in some
fields. In code that iterates through this table the statement

If Not IsNull([Field]) Then ...

(or If IsNull([Field]) Then ...)

is ignored when nulls are encountered in the field(s) in question. I
have verified that these fields are in fact null (not empty strings).

Does anybody know what's going on here?

Thanks
Dave

Nov 13 '05 #2

P: n/a
2nd example should have been:
Asc(rs!MyField)

"Allen Browne" <Al*********@SeeSig.Invalid> wrote in message
news:41***********************@per-qv1-newsreader-01.iinet.net.au...
Identify one of the fields in one record that displays this behavior.
Open a recordset that returns this record, and ask Access what's there,
e.g.:
Debug.Print Len(rs!MyField), Len(rs!MyField)

Nov 13 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.