473,406 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

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

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
2 1720
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: jdph40 | last post by:
Question 1: In Access 97, I have a form (frmVacationWeeks) with a subform (sbfrmPostVacDates). The subform can have up to 33 records and each record has 2 checkboxes, one for approved and one for...
3
by: Orchid | last post by:
Hello All, Hope someone can help me on my required field problems. I have a form base on a table for users to input new Employees. There are 4 fields that cannot be Null when entering new...
10
by: Regnab | last post by:
I'm trying to test a recordset to see if the SQL query is returning a Null value. However, the IsNull() test always returns a 'False' response. I even tried: Dim NullCheck As String NullCheck =...
6
by: EDOnLine | last post by:
New asp.net/webform user question...... I am trying to use the Custom Validator control to check to see if either of two fields on my form have been filled in. At this point all I am interested...
4
by: subaruwrx88011 | last post by:
So I pressed tab-enter and posted an incomplete topic, sorry. I have imported information into a database using a file. It is tab delimited and for NULL fields I have NULL. example file.txt...
2
by: Raoul Watson | last post by:
I have used isNull statement for as long as I have used VB.. Recently I am devugging a program and it is very clear that the "IsNull" function sometimes would return a true even when the value is...
2
by: Hexman | last post by:
Hello All, In SS EE I have nulls in a column. I want to select and eventually change to a zero (its a smallint column). I've tried selecting 'null', 'dbnull', etc. Then I read about the ISNULL...
5
by: rdemyan via AccessMonster.com | last post by:
I have a need to add another field to all of my tables (over 150). Not data, but an actual field. Can I code this somehow. So the code presumabley would loop through all the tables, open each...
22
by: PW | last post by:
Hi All, I go into debug mode with the code below and varReturnVal is Null, but the code still is run. Any idea why? Dim varReturnVal As Variant Dim intDogID As Integer
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.