Link to home
Start Free TrialLog in
Avatar of mamadouthiam
mamadouthiam

asked on

Requery an unlinked subform

I have a subform (one of several on a larger form) that is not linked to the form.  It is just sitting there displaying information.

On the form itself, there is a combo box which (upon picking a value) provides the parameter for the query that underlies said subform.  However, when I try to have the subform update when changes in the combo box are made- no joy.  I tried a requery after update on the combo box but I imagine the problem to be that since there is no link between the main form and the subform that this does not occur.

The question is...How can I force the requery on this unlinked subform when a change in the combobox is made?

Thanks,

mamadouthiam
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

Hi mamadouthiam,
I would guess that the code you neeed is:

me.subreportcontrolname.Form.requery

in the afterupdate event procedure of the combobox.

Pete
yes, that works OK - Ive just tested it here.


Pete
Avatar of mamadouthiam
mamadouthiam

ASKER

Pete,

I tried but I got the error that the database can't find a macro entitled me.subreportcontrolname.Form.requery.  Any idea why it thinks the "me" is referencing a macro?

mamadouthiam
ASKER CERTIFIED SOLUTION
Avatar of peter57r
peter57r
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Pete,  

You got it.

I put the code in the expression builder not in the VBA. OOops.

Many thanks