Hidding Fields in forms

  • Thread starter Thread starter NICK READ III
  • Start date Start date
N

NICK READ III

Is it possible to keep a field hidden in a form until a
spefic piece of data is entered into the form on another
field.

TA
 
Yes. In your OnUpdate code for the 'other' field enter something like...

If SomeField = SomeValue Then
FieldToHide.visible = true
End If

To start the field hidden, change the field's property to visible = no or in
your form OnOpen, set it as follows...

FieldToHide.Visible = False


HTH

Rick B


Is it possible to keep a field hidden in a form until a
spefic piece of data is entered into the form on another
field.

TA
 
Rick,
What would be the code for this similar scenario. Let's say I have 3
fields and the visibility of BOTH Field2 and Field3 depend on the value
of Field1.

For example, I would want Field2 and Field3 to be invisible to begin
with. If Field1 = 1, then I want Field2 to be visible. If Field1 = 2,
then I want Field3 to be visible.
Hope that wasn't too confusing. Thanks,
Darrell
 
Something like:

If Field1 = 1 Then
Field2.visible = True
Else If Field1 = 2 Then
Field 3.visible = True
End If


I don't use 'else's very often, so I think that syntax is correct. See the
help file if not or post back and I will test it out.

Rick B






Rick,
What would be the code for this similar scenario. Let's say I have 3
fields and the visibility of BOTH Field2 and Field3 depend on the value
of Field1.

For example, I would want Field2 and Field3 to be invisible to begin
with. If Field1 = 1, then I want Field2 to be visible. If Field1 = 2,
then I want Field3 to be visible.
Hope that wasn't too confusing. Thanks,
Darrell
 
Rick,
That was very close and thanks for getting me started. This is what I
ended up having to use (bascially, it's 2 separate If statements, one
right after the other):
If Source = "Other" Then
SourceOther.Visible = True
Else: SourceOther.Visible = False
End If
If Source = "Referral" Then
Referrer.Visible = True
Else: Referrer.Visible = False
End If
 
Back
Top