Enabled/Disabled text boxes

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
 
R

Reggie

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!
 
M

Marc

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

----------



.
 

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

Top