make fields Visible or not

G

Guest

I have a form with 3 fields that have "yes/no" answers (checkbox). If any of
the questions is answered "yes" a set of questions appear, and if the answer
is "no" another set of questions appear. However, I want the "yes" set of
questions to appear only one time if the anwser for any of these 3 questions
is yes, and the "no" set of questions to appear only once if any of the
questions is answered "no". Is there a way to do this?
 
G

Guest

Miguel Vivar said:
I have a form with 3 fields that have "yes/no" answers (checkbox). If any of
the questions is answered "yes" a set of questions appear, and if the answer
is "no" another set of questions appear. However, I want the "yes" set of
questions to appear only one time if the anwser for any of these 3 questions
is yes, and the "no" set of questions to appear only once if any of the
questions is answered "no". Is there a way to do this?

One way to do this is to add your yes responses and no responses. In
properties for the response questions, make Visible=False.

Add a command button, cmdNext. The code behind the button is:
Private Sub cmdNext_Click()
If Check1 = -1 Or Check2 = -1 Or Check3 = -1 Then
Check4.Visible = True
Check5.Visible = True
Check6.Visible = True
Yes1.Visible = True
Yes2.Visible = True
Yes3.Visible = True
End If
If Check1 <> -1 Or Check2 <> -1 Or Check3 <> -1 Then
Check7.Visible = True
Check8.Visible = True
Check9.Visible = True
No1.Visible = True
No2.Visible = True
No3.Visible = True
End If
End Sub
In the OnOpen even, use the following code:
Private Sub Form_Open(Cancel As Integer)
Check1.Value = 0
Check2.Value = 0
Check3.Value = 0
End Sub

If the user checks one or two boxes, both yes and no response questions will
appear. If the user checks all three, only the yes response questions should
appear and if the user doesn't check anything, only the no response questions
should appear.

Did this in Access 2003 but shoudl work in earlier versions.

If this does not help, respond with more specifics.

Roxie Aho
roxiea at usinternet.com
 
L

Larry Daugherty

You haven't defined your desired Problem/Solution well enough to be
answered succinctly.

As given, your question might as well read **for the first answer
received to any of the first 3 questions, if the answer is Yes then
show the "yes" questions below. If the answer was No then show the
"no" questions below.**

However you don't tell what to do when more than one of the first
questions is answered. It is possible that you will receive one or
more Yes or No. Do you then want to show both sets of answers below??

HTH
 
G

Guest

Larry:
If more than one question is answered "yes" I still want the set of
questions for this answer to appear only one time. In addition, if the
questions are answered "no" more than one time, I want the set of questions
for this answer to appear only once. All the questions have the
"required-yes" property.To make it more explicit, I have 3 questions to be
anwered "yes" or "no", and in addition I have two sets of questions. One for
the "no" answer, and one for the "yes" answer. If any of the 3 questions are
answered "yes" (even more than once) I want the "yes" set of questions to
appear only once, and the same twith the "no" answer.

Miguel
 
G

Guest

Is there a way to do it using Macro?

Larry Daugherty said:
You haven't defined your desired Problem/Solution well enough to be
answered succinctly.

As given, your question might as well read **for the first answer
received to any of the first 3 questions, if the answer is Yes then
show the "yes" questions below. If the answer was No then show the
"no" questions below.**

However you don't tell what to do when more than one of the first
questions is answered. It is possible that you will receive one or
more Yes or No. Do you then want to show both sets of answers below??

HTH
 

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