refreshing combo box on a subform

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

Guest

Hello,

I have a form with a subform used for data entry. The subform has a combo
box (Task) that is populated based on a control in the main form.

I also have a "new record" button on the main form so the users can start
another record. When we go to a new record, the Task box does not reset. I've
tried adding DoCmd.requery to the code of the new record button, but that
doesn't seem to do anything.

What should I be doing?

Thanks,
 
Try and refresh the combo box on the after update event of the control that
the combo is based on.

forms![MainFormName]![SubFormName].Form![ComboName].requery
or you can refresh the combo on the got focus event of the combo.

Its look like you trying to refresh the combo before there is a value in
control that the conbo is based on
 
Thanks Ofer,

You were exactly right. Thanks for the quick response.

Marc

Ofer said:
Try and refresh the combo box on the after update event of the control that
the combo is based on.

forms![MainFormName]![SubFormName].Form![ComboName].requery
or you can refresh the combo on the got focus event of the combo.

Its look like you trying to refresh the combo before there is a value in
control that the conbo is based on

Marc said:
Hello,

I have a form with a subform used for data entry. The subform has a combo
box (Task) that is populated based on a control in the main form.

I also have a "new record" button on the main form so the users can start
another record. When we go to a new record, the Task box does not reset. I've
tried adding DoCmd.requery to the code of the new record button, but that
doesn't seem to do anything.

What should I be doing?

Thanks,
 
Any time

Marc said:
Thanks Ofer,

You were exactly right. Thanks for the quick response.

Marc

Ofer said:
Try and refresh the combo box on the after update event of the control that
the combo is based on.

forms![MainFormName]![SubFormName].Form![ComboName].requery
or you can refresh the combo on the got focus event of the combo.

Its look like you trying to refresh the combo before there is a value in
control that the conbo is based on

Marc said:
Hello,

I have a form with a subform used for data entry. The subform has a combo
box (Task) that is populated based on a control in the main form.

I also have a "new record" button on the main form so the users can start
another record. When we go to a new record, the Task box does not reset. I've
tried adding DoCmd.requery to the code of the new record button, but that
doesn't seem to do anything.

What should I be doing?

Thanks,
 
Back
Top