Make fields unavailable

  • Thread starter Thread starter JR
  • Start date Start date
J

JR

In a form, I'm trying to make certain fields only
available to a user based on his previous answers. For
example, let's say the question is: "Did you set an
appointment?" w/ a Yes/No option. If he answers "Yes,"
then the Date, Time, & Location fields become available
to him. If he answers "No," they're unavailable to him.

I'm still learning Access and am stuck. Thanks in
advance.

JR
 
In a form, I'm trying to make certain fields only
available to a user based on his previous answers. For
example, let's say the question is: "Did you set an
appointment?" w/ a Yes/No option. If he answers "Yes,"
then the Date, Time, & Location fields become available
to him. If he answers "No," they're unavailable to him.

I'm still learning Access and am stuck. Thanks in
advance.

JR

Basically, you would set the fields Enabled property depending on the
input from checkbox chkSetAppt. Use the After Update event to modify
the controls. (BTW, the Date & Time should be combined)
For example ...

Me.txtDateTime.Enabled = Me.chkSetAppt
Me.txtLocation.Enabled = Me.chkSetAppt

It sounds like the default of txtDateTime & txtLocation would be NOT
enabled - they would be enabled or not depending on the response to
chkSetAppt.

- Jim
 
Basically, you would set the fields Enabled property depending on the
input from checkbox chkSetAppt. Use the After Update event to modify
the controls. (BTW, the Date & Time should be combined)
For example ...

Me.txtDateTime.Enabled = Me.chkSetAppt
Me.txtLocation.Enabled = Me.chkSetAppt

It sounds like the default of txtDateTime & txtLocation would be NOT
enabled - they would be enabled or not depending on the response to
chkSetAppt.

- Jim


Bear in mind that you will need to have code in the OnCurrent Event to
Enable (or not) the fields based on the controlling values in the
other fields of existing records and on what you want as defaults for
new records, otherwise they will always staty in their last "state".

Please respond to the Newsgroup, so that others may benefit from the exchange.
Peter R. Fletcher
 
Back
Top