Refreshing a subform

  • Thread starter Thread starter Gary
  • Start date Start date
G

Gary

The basic problem I am having is trying to refresh a subform
I have a main form with one subform
The main form has a combo box
The selection of the main form combo box filters the selections in a
combo box on the subform
Both combo boxes are bound
The combo box in the sub form does not filter until I refresh the sub
form
I can go to the subform and hit the refresh button on the ribbon and the
subform refreshes and the combo box on the subform filters according to
the main form combo box

But I can't get the subform to refresh using code
Hope this all makes since I will be glad to provide more information if
required

Thanks for your help
Gary
 
Gary said:
The basic problem I am having is trying to refresh a subform
I have a main form with one subform
The main form has a combo box
The selection of the main form combo box filters the selections in a
combo box on the subform
Both combo boxes are bound
The combo box in the sub form does not filter until I refresh the sub
form
I can go to the subform and hit the refresh button on the ribbon and the
subform refreshes and the combo box on the subform filters according to
the main form combo box

But I can't get the subform to refresh using code
Hope this all makes since I will be glad to provide more information if
required


You may not need to "refresh" the entire subform just to
sync its combo box. Try using this kind of thing in the
main form combo box's AfterUpdate event procedure:
Me.[subform control].Form.[subform combo box].Requery

If your main form is not limited to a single record, then
you will need the same line of code in the main form's
Current event.
 
Works Great thanks for you time on a sunday morning


Gary said:
The basic problem I am having is trying to refresh a subform
I have a main form with one subform
The main form has a combo box
The selection of the main form combo box filters the selections in a
combo box on the subform
Both combo boxes are bound
The combo box in the sub form does not filter until I refresh the sub
form
I can go to the subform and hit the refresh button on the ribbon and
the subform refreshes and the combo box on the subform filters
according to the main form combo box

But I can't get the subform to refresh using code
Hope this all makes since I will be glad to provide more information
if required


You may not need to "refresh" the entire subform just to
sync its combo box. Try using this kind of thing in the
main form combo box's AfterUpdate event procedure:
Me.[subform control].Form.[subform combo box].Requery

If your main form is not limited to a single record, then
you will need the same line of code in the main form's
Current event.
 
Back
Top