Enabled/Disabled text boxes

  • Thread starter Thread starter Marc
  • Start date Start date
M

Marc

Hi,

Is it possible to make a text box in a form enabled or
disabled depending on what choice is made in a combo box
on the form?

I am in Access 2000.

Thanks,

Marc
 
Marc, sure is. In the afterupdate event of the combobox just do something like

Private Sub cboMyComboBox_AfterUpdate()
If Me.cboMyCombo = "this" Then
Me.myTextBox.Enabled = False
Else
Me.myTextBox.Enabled = True
End If
End Sub

Note: If the textbox is located on a subform you will have to refrence it like so:

Me.MySubform.Form.myTextBox.Enabled=False

Hope it helps!
 
Thanks Reggie!

Marc
-----Original Message-----
Marc, sure is. In the afterupdate event of the combobox just do something like

Private Sub cboMyComboBox_AfterUpdate()
If Me.cboMyCombo = "this" Then
Me.myTextBox.Enabled = False
Else
Me.myTextBox.Enabled = True
End If
End Sub

Note: If the textbox is located on a subform you will have to refrence it like so:

Me.MySubform.Form.myTextBox.Enabled=False

Hope it helps!
--
Reggie

----------



.
 
Back
Top