Need to Enable/Disable fields in Access

micki_free

New member
Local time
Yesterday, 19:28
Joined
May 1, 2008
Messages
8
Hi guys, I have a huge problem with a table I'm currently making and I was hoping you could help.

I have created a field in one of my tables using a Combobox lookup that only allows users to enter one of two options. What I want to do is restrict the other fields that a user can enter data into based on the their selection in the lookup field.

i.e if they select the first option then they can see and enter data into a few additional fields (but not others). Likewise if they select the second option they see/dont see other fields.

I am using Microsoft Access 2003.
 
In your form using the AfterUpdate event of the control containing the drop-down list use something like this:

Code:
If Me.MyDropDown = "My Text" Then
    Me.ThisControl1.Visible = False
    Me.ThisControl2.Enabled = False
ElseIf Me.MyDropDown = "Some Other Text" Then
    Me.AnotherControl1.Visible = True
    Me.AnotherControl2.Enabled = True
EndIf

Using code like above behind your drop-down's AfterUpdate event you can control whether or not certain controls are enabled, visible, etc.
 

Users who are viewing this thread

Back
Top Bottom