Disable field, unless....

  • Thread starter Thread starter FpwL1399
  • Start date Start date
F

FpwL1399

I have a field that I would like to be disabled unless a value in a
drop down menu is selected. Is there any way to do this. I'm sure
there is. Thanks in advance.
 
Set the field to locked in the On Current Event (Me.YourControl.Locked =
True), then toggle it to unlocked using the After Update event of the
dropdown:

If Me.YourComboBox = "SpecificValue" Then
Me.YourControl.Locked = False
Else Me.YourControl.Locked = True
End If
 
Would that work for enabled instead of locked? I would kind of like it
to go gray when not in use.
 
Awesome....except i'm having some trouble with it. I'm working on
troubleshooting it now....I'll let you know how it goes.
 
Well, I'm having trouble getting it to work. I couldn't find the on
current box, so I just set the enabled box to NO. I put the code in
and made sure the names and everything was right, but it's not working.
Any suggestions?
 
I found on current.... here is what I have so far:

Private Sub Form_Current()
Me.EngineeringThickness.Enabled = False
End Sub

Private Sub Form_AfterUpdate()
If Me.Combo30 = "Engr." Then
Me.EngineeringThickness.Enabled = True
Else
Me.EngineeringThickness.Enabled = False
End If
End Sub

Do you see anything wrong with this? If so, I would appreciate your
input.
 
Yes exactly - sorry if I was unclear - this needs to go in the After Update
or OnCHange event of the Combobox, not the form.

My bad!

SusanV
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top