A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Database Design
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Table design for validation



 
 
Thread Tools Display Modes
  #1  
Old August 18th, 2007, 04:38 PM posted to microsoft.public.access.tablesdbdesign
TomC
external usenet poster
 
Posts: 46
Default Table design for validation

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
  #2  
Old August 18th, 2007, 10:35 PM posted to microsoft.public.access.tablesdbdesign
Jeff Boyce
external usenet poster
 
Posts: 1,555
Default Table design for validation

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
http://mvp.support.microsoft.com/

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


"TomC" wrote in message
...
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


  #3  
Old August 19th, 2007, 02:08 AM posted to microsoft.public.access.tablesdbdesign
TomC
external usenet poster
 
Posts: 46
Default Table design for validation

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!

"Jeff Boyce" wrote:

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
http://mvp.support.microsoft.com/

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


"TomC" wrote in message
...
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



  #4  
Old August 20th, 2007, 02:31 PM posted to microsoft.public.access.tablesdbdesign
Jamie Collins
external usenet poster
 
Posts: 1,705
Default Table design for validation

On 18 Aug, 22:35, "Jeff Boyce" -
DISCARD_HYPHEN_TO_END wrote:
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???


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.

--


  #5  
Old August 20th, 2007, 02:57 PM posted to microsoft.public.access.tablesdbdesign
Jeff Boyce
external usenet poster
 
Posts: 1,555
Default Table design for validation

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
http://mvp.support.microsoft.com/

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

"TomC" wrote in message
...
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


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:45 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.