how do i connect two feilds through a validation rule?

G

Guest

My name is Tim.
I am currently working an internship with a department with little help from
my professors. I am currently trying to set up a validation rule for two
fields. The two feilds are "Lock" which has a yes/no opion to it and the
other is "Lock Information" which will hold the lock information about the
lock. The validation rule that I would like to create is sort of linking the
two feilds. Something like this.....
If Lock is yes then Lock information is required.
If Lock is no then Lock Information is not required.

Is this possible?
 
G

Guest

As far as i know, you can perform this kind of validation on a form.

Use the AfterUpdate property of the form's lock control e.g. right-click the
lock checkbox and build an event

If lock = True Then
lockinfo.Enabled = True
else
lockinfo.Enabled = false
endif

You can use a Macro to do the same thing and call the macro with the
AfterUpdate() event

Rgrds,
 
T

Tim Ferguson

If Lock is yes then Lock information is required.
If Lock is no then Lock Information is not required.

Faulty data analysis; you don't have two separate bits of information here,
since <no lock information> is just one type of lock information.

You need a single field; you could either settle for a NULL value to
indicate that there is no lock information, or you could establish a
specific <no lock information> value to use. It's still a single domain.

Using a _table level_ validation rule like

(Lock = TRUE) XOR (LockInformation IS NULL)

will achieve what you describe, but it won't make it right.

Hope that helps


Tim F
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top