Yes/No check box Condition

G

Guest

I have a form in which the user selects a check box for yes.

Problem: I want 2 other fields to appear when this check box is checked and
disappear when the check box is not check.

Please help.
Thank you,
Monster
 
F

fredg

I have a form in which the user selects a check box for yes.

Problem: I want 2 other fields to appear when this check box is checked and
disappear when the check box is not check.

Please help.
Thank you,
Monster

Code the check box control's AfterUpdate event, as well as the Form's
Current event:

[ControlA].Visible = [CheckBoxName] = -1
[ControlB].Visible = [CheckBoxName] = -1
 
T

Tom Lake

Code the check box control's AfterUpdate event, as well as the Form's
Current event:

[ControlA].Visible = [CheckBoxName] = -1
[ControlB].Visible = [CheckBoxName] = -1

Or the following which is clearer (IMHO)

If [CheckBoxName] = True Then
[ControlA].Visible = True
[ControlB].Visible = True
Else
[ControlA].Visible = False
[ControlB].Visible = False
End If

Tom Lake
 
G

Guest

Thank you both my problem was fixed. And so that none of you feel bad I used
one method in one form and the other method in the other form and they both
work!

Tom Lake said:
Code the check box control's AfterUpdate event, as well as the Form's
Current event:

[ControlA].Visible = [CheckBoxName] = -1
[ControlB].Visible = [CheckBoxName] = -1

Or the following which is clearer (IMHO)

If [CheckBoxName] = True Then
[ControlA].Visible = True
[ControlB].Visible = True
Else
[ControlA].Visible = False
[ControlB].Visible = False
End If

Tom Lake
 

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