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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|