C
Carlos1815
I have a project where I would like the text box controls of a form to
be disabled according to the choice made from a combo box. I've seen
questions similar to this many times in this forum, but none of the
answers seem to work for me. Here's what I have:
A form with text box controls to enter data. I also have a combo box
with two choices. Choice A, all the text box controls are Enabled.
If Choice B is chosen, I would like all the text boxes to be disabled
and greyed out, but only for those records that have "Choice B"; all
other records that have "Choice A" in the combo box, I would like to
leave the text boxes enabled.
On the combo box After Update event, I have this code (cboPageType is
the combo box, and PageName and Text are the names of two of the text
boxes I would like disabled upon choosing "Choice B", which in this
case is "CompCheck_Page"):
Private Sub cboPageType_AfterUpdate()
If Me.cboPageType = "CompCheck_Page" Then
Me.PageName.Enabled = False
Me.Text.Enabled = False
Else
Me.PageName.Enabled = True
Me.Text.Enabled = True
End If
End Sub
However, nothing happens when I choose "Choice B" or "Choice A"; as if
the code doesn't exist. The combo box is bound to a separate table
with the two choices in it. I think that's all the information I
have. If anyone can see an answer to this conunudrum, I would
appreciate any help! Thank you.
Carlos
be disabled according to the choice made from a combo box. I've seen
questions similar to this many times in this forum, but none of the
answers seem to work for me. Here's what I have:
A form with text box controls to enter data. I also have a combo box
with two choices. Choice A, all the text box controls are Enabled.
If Choice B is chosen, I would like all the text boxes to be disabled
and greyed out, but only for those records that have "Choice B"; all
other records that have "Choice A" in the combo box, I would like to
leave the text boxes enabled.
On the combo box After Update event, I have this code (cboPageType is
the combo box, and PageName and Text are the names of two of the text
boxes I would like disabled upon choosing "Choice B", which in this
case is "CompCheck_Page"):
Private Sub cboPageType_AfterUpdate()
If Me.cboPageType = "CompCheck_Page" Then
Me.PageName.Enabled = False
Me.Text.Enabled = False
Else
Me.PageName.Enabled = True
Me.Text.Enabled = True
End If
End Sub
However, nothing happens when I choose "Choice B" or "Choice A"; as if
the code doesn't exist. The combo box is bound to a separate table
with the two choices in it. I think that's all the information I
have. If anyone can see an answer to this conunudrum, I would
appreciate any help! Thank you.
Carlos