conditional invisible

G

garlic

How to invisible a field(text) when another field (Y/N) is selected No.


Thanks
Alvin
 
J

jubiiab via AccessMonster.com

'If you are using combox try this:

If [cboBoxName] = "No" Then
Me.[FieldName].Visible = True
Else
Me.[FieldName].Visible = False
End If

'if you are using checkbox you have to write in the IF statement "False" or "-
1"...i don't remember. Try this:

If [checkBoxName] = False Then
Me.[FieldName].Visible = True
Else
Me.[FieldName].Visible = False
End If

' I think -1 was yes and 0 is No. you can also try this if the above code
didnt work:

If [checkBoxName] = 0 Then
Me.[FieldName].Visible = True
Else
Me.[FieldName].Visible = False
End If
 
R

RonaldoOneNil

In the after update event of this "another field" put this code (substitute
your actual field names where appropriate)

[TextField].Visible = [AnotherField]
 
J

jubiiab via AccessMonster.com

I forgot to write that you have to use "On Current" in the form properties
'If you are using combox try this:

If [cboBoxName] = "No" Then
Me.[FieldName].Visible = True
Else
Me.[FieldName].Visible = False
End If

'if you are using checkbox you have to write in the IF statement "False" or "-
1"...i don't remember. Try this:

If [checkBoxName] = False Then
Me.[FieldName].Visible = True
Else
Me.[FieldName].Visible = False
End If

' I think -1 was yes and 0 is No. you can also try this if the above code
didnt work:

If [checkBoxName] = 0 Then
Me.[FieldName].Visible = True
Else
Me.[FieldName].Visible = False
End If
How to invisible a field(text) when another field (Y/N) is selected No.

Thanks
Alvin
 
L

Linq Adams via AccessMonster.com

Note that you have to use any of these codes in the Form_Current event
***and*** in the AfterUpdate event of the Yes/No control..

Also note that this code will only work in a Single View Form, not in a
Continuous View or Datasheet View Forms.
 

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