422,767 Members | 1,136 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 422,767 IT Pros & Developers. It's quick & easy.

Validation question for Access my code is not working

P: 9
I am trying to enter in a validation and the code is not working. It is stating my Syntax is wrong. I have two fields Group Name and Facility Name. I only want the user to use enter data into one field or other not both.
I listed the validation on the table in the facility field
Expand|Select|Wrap|Line Numbers
  1. [facilityName]IsNull XOR [GroupName]IsNull
Should I list the rule in both fields or just one?
Is the syntax correct? I believe I am missing a comma or "" somewhere
thank you
Sep 11 '17 #1
Share this Question
Share on Google+
1 Reply

Expert Mod 15k+
P: 30,744
The SQL syntax would be IS NULL. Over and above that there is a library function called IsNull(). I believe some versions of SQL (Not Jet/ACE) also have an IsNull() that has a different syntax from the one used within Access.

Obviously the IS NULL check is better than a call to a function such as IsNull(). Your code might look like :
Expand|Select|Wrap|Line Numbers
  1. ([FacilityName] Is Null) XOR ([GroupName] Is Null)
Sep 11 '17 #2

Post your reply

Sign in to post your reply or Sign up for a free account.