combox option

G

Guest

I have created a control with the options "yes" and "no". I have used the
combo box instead of the check box. Now, I want one question to appear if the
answer is "yes", and I don't want it to appear if the answer is "no". I have
created a condition setting the control equal to "True" if the question is
answered with "yes". I just wonder if that will work?. I learned that it will
work for a checkbox, but I'm not sure if it will work with a combo box. I
have tried this technique, but no luck so far.

Miguel
 
G

Guest

The only difference is you would need to change the True and False to "Yes"
and "No".

Curious as to why you would use a combo box instead of a check box.
 
G

Guest

uKlatuu:
I did write my control equal to "yes", but I get a message that says: "type
mismatch". Do you know whay I get that?
I think I will use a combo box because the control must be answered, and
since the check box is not set to either "yes" or "no" I would have to to
click twice in order to get the "no" answers (this is another set of
questions that I want to appear, I just needed the technique to apply to
other macros and forms)
Miguel
 
G

Guest

Without seeing your code, I can't tell why you get a type mismatch.
I don't know what you mean by "control must be answered". Unless you
explicitly code a control to require an answer, it does not.
As to a check box not being set to either yes or no, all you need to do is
set the defalut value property to the one you want.
 
G

Guest

Klattu:
This is my code in my macro:
[Forms]![Daily table]![Did any significant negative experience occur last
night?]=Yes
The combo box for this control has as a set of answers as the following:
"yes" and "no" (with the "limited to list" option)
If the answer is "yes" it's supposed to open the form:
"How stressful was this experience"
is this infomartion helpful for you?
Miguel
 
G

Guest

Sorry, Miguel, I don't understand the code in your macro. What is the Action
for the macro? The code you posted doesn't look like a macro to me; however,
I seldom use a macro.

What I would suggest would be to put the following VBA code in the After
Update event of your combo box:

If Me![Did any significant negative experience occur last night?] = "Yes" Then
DoCmd.OpenForm "How stressful was this experience"
End If


If Me.

Miguel Vivar said:
Klattu:
This is my code in my macro:
[Forms]![Daily table]![Did any significant negative experience occur last
night?]=Yes
The combo box for this control has as a set of answers as the following:
"yes" and "no" (with the "limited to list" option)
If the answer is "yes" it's supposed to open the form:
"How stressful was this experience"
is this infomartion helpful for you?
Miguel

Klatuu said:
Without seeing your code, I can't tell why you get a type mismatch.
I don't know what you mean by "control must be answered". Unless you
explicitly code a control to require an answer, it does not.
As to a check box not being set to either yes or no, all you need to do is
set the defalut value property to the one you want.
 
G

Guest

ok katluu, I will use the code you gave, thanks.
Miguel

Klatuu said:
Sorry, Miguel, I don't understand the code in your macro. What is the Action
for the macro? The code you posted doesn't look like a macro to me; however,
I seldom use a macro.

What I would suggest would be to put the following VBA code in the After
Update event of your combo box:

If Me![Did any significant negative experience occur last night?] = "Yes" Then
DoCmd.OpenForm "How stressful was this experience"
End If


If Me.

Miguel Vivar said:
Klattu:
This is my code in my macro:
[Forms]![Daily table]![Did any significant negative experience occur last
night?]=Yes
The combo box for this control has as a set of answers as the following:
"yes" and "no" (with the "limited to list" option)
If the answer is "yes" it's supposed to open the form:
"How stressful was this experience"
is this infomartion helpful for you?
Miguel

Klatuu said:
Without seeing your code, I can't tell why you get a type mismatch.
I don't know what you mean by "control must be answered". Unless you
explicitly code a control to require an answer, it does not.
As to a check box not being set to either yes or no, all you need to do is
set the defalut value property to the one you want.

:

uKlatuu:
I did write my control equal to "yes", but I get a message that says: "type
mismatch". Do you know whay I get that?
I think I will use a combo box because the control must be answered, and
since the check box is not set to either "yes" or "no" I would have to to
click twice in order to get the "no" answers (this is another set of
questions that I want to appear, I just needed the technique to apply to
other macros and forms)
Miguel

:

The only difference is you would need to change the True and False to "Yes"
and "No".

Curious as to why you would use a combo box instead of a check box.

:

I have created a control with the options "yes" and "no". I have used the
combo box instead of the check box. Now, I want one question to appear if the
answer is "yes", and I don't want it to appear if the answer is "no". I have
created a condition setting the control equal to "True" if the question is
answered with "yes". I just wonder if that will work?. I learned that it will
work for a checkbox, but I'm not sure if it will work with a combo box. I
have tried this technique, but no luck so far.

Miguel
 

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

Similar Threads


Top