Blank fields seen as duplicates (1 Viewer)

L

Linda

Guest
Hi, I have a table with several columns, five of which could have numbers. The first column must have a number, the other four may or may not have numbers. In all cases the number must not be duplicated. There are several validations in place, and everthing works well with current data. When I add a new record my "duplicate data" error message flashes and will not allow me to save even though I only have a unique number in the column that requires data. Through investigation I believe the "blank" fields are being seen as duplicated data. Am I correct in this and if so how do I get around it.
Thanks
Linda
 

Travis

Registered User.
Local time
Today, 08:52
Joined
Dec 17, 1999
Messages
1,332
Unfortuantly it sounds like you have the AllowDuplicates set to Don't for each of your fields. While this works great to prevent dup data it does not do well if a field could be blank. The only method to avoid this is to allow dups on everything but your ID field. Then create checks to make sure they other fields don't match appropriatly.
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 11:52
Joined
Feb 19, 2002
Messages
42,989
Make sure that the default value for the additional fields is null rather than zero. Then change your validation code to exclude null values. Use the IsNull() function for this.
 

Users who are viewing this thread

Top Bottom