Question Locked

Access Database-Can I make a field inactive until another is checked?

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am using Access 2007, and am wondering if it is possible to make a field inactive (or grayed out) until another selection is made in another field.

Any suggestions?

5 replies

by john.a.wills

Use VBA. At Form-Open, make it invisible. When the other control gets filled, make the invisible one visible. Alternatively or additionally you can change the value of the Enabled property - for that matter, you can change colors, which with the Enabled property may be what you want. Enabled is on the Data tab of the properties, the colors and the visibility are on the Format tab.

by src.costa

Something like this:
- Put 2 controls in a form:
- One checkbox and a textbox
- Change the property "Enable" of the Textbox to "False", so when you start the form,,it will be gray.
'- Put the code for the Checkbox click as showed below.

Private Sub Mycheckbox_Click()

If Me.Mycheckbox = True Then
Me.myTextBox.Enabled = True
Else
Me.myTextBox.Enabled = False
End If
End Sub

by robertswork

You don't need to do an IF/Then for the status of the checkbox. Just make the enabled property = the value of the checkbox

me.textbox_name.enabled = me.checkbox

You can place this line of code into the After_Update event of the checkbox

This discussion is closed to new replies.