Required field only if another field is empty

J

Joanne

Hello,
I am setting up a database of inventory for our computers. We have a table
called tblcomputers and a table called tblusers. Most of our computers are
matched to a login, e.g. the computer name GSMITH would be matched to a login
named GSMITH. There may also be a second computer called GSMITH2 which would
be matched to the GSMITH logon. So I have a one to many relationship of
computers to logins.

We also have a field called FLOOR and one called ROOM. On tblComputers, we
only want to enter information into these fields if the computer name is not
matched to a user id. For instance we have some scannner machines and guest
machines. How would I say that the FLOOR and ROOM fields are required only
if the computer ID isn't matched to a user? Thanks for all of your help.
 
J

Jeff Boyce

Joanne

It sounds as if you might be trying to do this directly in the table.
Access tables are great for storing data, but Access forms are design for
data-entry/edit, and have a very rich event environment.

Use forms and you'll be able to, say, use the form's BeforeUpdate event to
check on whether values have been added to fields. This is where you could
do the validation you described.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 

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