Null Values Different Per User

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

Guest

10 users are using an app I created. Some are seeing a macro run erroneously. The macro has simple conditions included (if Field A Is Not Null and Field B Is Null and Field C Is Null, set value of Status to 1; if Field A Is Not Null and Field B Is Not Null and Field C Is Null, set value of Status to 2, etc...).

For some, the macro is recognizing all blank fields as 'Not Null'. Is there any way that a blank field could be recognized as a Null field by some, and not by others? Isn't the setting for Null values a field property? Or might there be an app level setting as well

Thanks in advance.
 
There are several things that could confuse this.

1. Nulls verses Zero Length Strings
Open your table in design view. For each of the Text type fields (and Memo
and Hyperlink), set the Allow Zero Length property to No in the lower pane.
The property defaulted to No in all versions before Access 2000, so the
confusion only happens since then.

2. Bracket your condition, e.g.:
([Field A] Is Null) And ([Field B] Is Null) And ([Field C] Is Null)
This will ensure the operators are interpreted correctly.
For complex conditions, be aware that:
(A and B) or C
is not the same as:
A and (B or C)

3. Double-check the names.
The marco has no error handling, and you may simply get unexpected results
if the field/control names are not correct. Using the Debug Window (Ctrl+G)
may help trace problems, e.g.:
? (Forms![NameOfYourForm]![Field A] Is Null)

4. Turn off Name AutoCorrect
Under Tools | Options | General, deselect the Name AutoCorrect check boxes
to make sure you are getting consistent results.

Quite seriously, for 10 users, you need to split the database and give each
user their own local copy of the front end, with code rather than macros so
you have error handling. There is a wizard to get you started with
converting the macros to code.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Pete Merenda said:
10 users are using an app I created. Some are seeing a macro run
erroneously. The macro has simple conditions included (if Field A Is Not
Null and Field B Is Null and Field C Is Null, set value of Status to 1; if
Field A Is Not Null and Field B Is Not Null and Field C Is Null, set value
of Status to 2, etc...).
For some, the macro is recognizing all blank fields as 'Not Null'. Is
there any way that a blank field could be recognized as a Null field by
some, and not by others? Isn't the setting for Null values a field property?
Or might there be an app level setting as well?
 
The other thing to check if you are getting different results on different
computers is the service packs.

Locate the files
- msaccess.exe (typically under Program Files\Microsoft Office\...
- msjet40.dll (typically in Windows\System32).
Right-Click, choose Properties, and check the number of the Version tab.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

Allen Browne said:
There are several things that could confuse this.

1. Nulls verses Zero Length Strings
Open your table in design view. For each of the Text type fields (and Memo
and Hyperlink), set the Allow Zero Length property to No in the lower pane.
The property defaulted to No in all versions before Access 2000, so the
confusion only happens since then.

2. Bracket your condition, e.g.:
([Field A] Is Null) And ([Field B] Is Null) And ([Field C] Is Null)
This will ensure the operators are interpreted correctly.
For complex conditions, be aware that:
(A and B) or C
is not the same as:
A and (B or C)

3. Double-check the names.
The marco has no error handling, and you may simply get unexpected results
if the field/control names are not correct. Using the Debug Window (Ctrl+G)
may help trace problems, e.g.:
? (Forms![NameOfYourForm]![Field A] Is Null)

4. Turn off Name AutoCorrect
Under Tools | Options | General, deselect the Name AutoCorrect check boxes
to make sure you are getting consistent results.

Quite seriously, for 10 users, you need to split the database and give each
user their own local copy of the front end, with code rather than macros so
you have error handling. There is a wizard to get you started with
converting the macros to code.

Pete Merenda said:
10 users are using an app I created. Some are seeing a macro run
erroneously. The macro has simple conditions included (if Field A Is Not
Null and Field B Is Null and Field C Is Null, set value of Status to 1; if
Field A Is Not Null and Field B Is Not Null and Field C Is Null, set value
of Status to 2, etc...).
For some, the macro is recognizing all blank fields as 'Not Null'. Is
there any way that a blank field could be recognized as a Null field by
some, and not by others? Isn't the setting for Null values a field property?
Or might there be an app level setting as well?
Thanks in advance.
 
Back
Top