Table design for validation

T

TomC

I can best describe my problem with an example. I have a form which asks a
question and expects an answer of yes or no. I know I can validate the
answer by coding = "yes" or "no" in the validation rule parameter. My
problem is that there is a following question which requires answering only
if the preceding answer is yes. How can I validate that second answer only if
the preceding answer is yes??? I will skip the following answer if the
preceding answer is no.

Thanks for any help you might have for me,
Tomc
 
J

Jeff Boyce

Don't do it in the table! (you DID post your question in the tablesdbdesign
newsgroup, with a subject of "Table design")

Access tables store data. Access forms display it (for edit/add/...).

In a form, add a control for your Yes/No field. Then, in the control's
AfterUpdate event, set the .Enabled property of the "following
question"/control, something like:

Me!txtFollowingQuestion.Enabled = Me!chkYesNoCheckbox

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
 
T

TomC

I guess I was hoping that I would not have to use visual basic of which I am
not familiar. However, I will try to go with your suggestion and plug in my
names into your format. I'm getting compilation errors from my first
attempts, but I'll keep trying. Thanks!
 
J

Jamie Collins

Don't do it in the table! (you DID post your question in the tablesdbdesign
newsgroup, with a subject of "Table design")

I disagree: tables are IMO the best place for data validation rules
and I think that is what the OP is alluding to with their example.

However, I think the OP's multiple bit flags is the wrong approach.
See:

Bad SQL: Byting the Hand that Feeds You
http://www.dbazine.com/ofinterest/oi-articles/celko23

"Instead of a flag, sit down and develop an encoding for all the types
of charges, and make it extensible."

Jamie.

--
 
J

Jeff Boyce

Tom

As you might infer from the responses you received, there's more than one
way to accomplish your goal. Since this is a public newsgroup, feel free to
use the answer that best fits with your experience and skill level. (...
and remember to make a backup of your work BEFORE you try anything here!)

--
Regards

Jeff Boyce
www.InformationFutures.net

Microsoft Office/Access MVP


Microsoft IT Academy Program Mentor
http://microsoftitacademy.com/
 

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