Form / Subform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form with a subform.
I have a combo box that shows a list of employee names when you click on the
arrow. I have 6 fields on the main form. On one field I set the enabled
property to "No". I want this field to enable after you click on an
employee name. When I use the following: ExtraWeek.enabled for an event
procedure, I always get a run time error.

Thanks for your assistance.
 
Hi Steve,
ExtraWeek is the name of a yes/no field!
As far as what event - I clicked on the combo box field and used "On Change"
and started an event procedure.

Thanks for your help
 
Terry

I would suggest you use the After Update event of the combobox. Forms
don't have fields. If you have a checkbox on the form, which is bound
to the ExtraWeek field in the table, the checkbox control may or may not
be named ExtraWeek, so you need to check that (no pun intended). The
Enabled property refers to the control, so you have to use the name of
the control. So, try it along these lines...

Private Sub YourCombobox_AfterUpdate()
Me.YourCheckboxName.Enabled = True
End Sub

If it's possible for the user to delete the entry in the combobox so it
is blank again, and you then want the checkbox to not be enabled again,
you might do it like this...

Private Sub YourCombobox_AfterUpdate()
Me.YourCheckboxName.Enabled = Not IsNull(Me.YourCombobox)
End Sub
 
Back
Top