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.
 
Terry,

Is ExtraWeek the name of the textbox? What Event are you using?
 
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
 

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