Access-How do I make a field appear based on another field

H

Hospital Help

I am attempting to have field appear based on the response to another field.
I am creating a database for scheduling at a hospital and I will need certain
information gathered depending on what service the patient is calling for.
For example, if the response to the service question is psychology, I would
need a field that I do not need for any other service. Is there any way to do
this? Thanks in advance.

HH
 
R

ruralguy via AccessMonster.com

Hopefully you are referring to a control on your form rather than another
field in a table. You can control the Visibility of a control in the
AfterUpdate event of a control with similar code in the Current event of a
form.

If Len(Me.Control1 & "") > 0 Then
Me.Control2.Visible = True
Else
Me.Control2.Visible = False
End If

Another way to write this is:

Me.Control2.Visible = Len(Me.Control1 & "") > 0
 
Top