Refreshing a subform

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
 
M

Marshall Barton

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.
 
G

Gary

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.
 

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