Access validation Rule

i am trying to put this validation rule in:

([Field1] Is Null) OR ([Field2] Is Not Null)

but i keep getting the error:
"Invalid SQL Syntax - cannot use multiple columns in a column-level CHECK constraint
AA321Asked:
Who is Participating?
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Connect With a Mentor Database ArchitectCommented:
Where are you trying to do this?

You cannot reference another Field in a table in a validation rule.

mx
0
 
Surone1Connect With a Mentor Commented:
issnull([field4])
0
 
Surone1Commented:
isnull([field4])
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

 
AA321Author Commented:
I was putting it in one of my fields validation rule in microsoft access. The field name was "address"

([Field1] Is Null) OR ([Field2] Is Not Null)

So basically i put in the validation rule box:

([address] Is Null) OR ([town] Is Not Null)
0
 
Surone1Commented:
try:
isnull([adress]) or not isnull([town])
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
You cannot reference another Field in a table in a validation rule.

You can use any valid expression, like:

<> 0
> 1000 Or Is Null

>= #1/1/2008# And <#1/1/2009#

or

DLookup("CustomerID", "Customers", "CustomerID = Forms!Customers!CustomerID") Is Null

mx
0
 
Surone1Commented:
?? is my access broken then?
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
huh ?
0
 
Surone1Commented:
it accepted an and statement just now while testing, changed it to or and it stopped working..
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
I didn't say you can't use AND .... you cannot reference other fields in the table.

mx
0
 
Surone1Commented:
this is what i meant
validation.jpg
0
 
Surone1Commented:
i'm not saying it works since  it seems to create undesired behaviour
0
 
Surone1Commented:
never mind access changed the syntax for me..
0
 
Surone1Commented:
make  a new page with just this in it and upload it to the server as a new page, maybe it's helpfull
<?php phpinfo() ?>

Open in new window

0
 
Surone1Commented:
sorry for the mispost
0
 
DatabaseMX (Joe Anderson - Microsoft Access MVP)Database ArchitectCommented:
AA321

Just an FYI ... the Assisted Solution cannot work.

mx
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.