Subform Refresh

  • Thread starter Thread starter neil.mcdonald
  • Start date Start date
N

neil.mcdonald

Hi,

I'll try to explain this as best I can...

I have an unbound main form (formA) with several command buttons to
switch between subforms.

One of the subforms (formB) is based on a query, the criteria for
which comes from the form.

I need to be enter a year into a field on the subform, hit the refresh
button and change the query accordingly.

At the moment, this works fine if formB is opened on it's own, but as
soon as it's opened as a subform, the refresh button (me.requery)
doesn't seem to do anything.

Can anybody give me an idea of where I'm going wrong?

Thanks,

Neil
 
You have to build in a check to see if the form is loaded as a subform or if
it is loded as a parentform (single form). In the latter you can refer to it
as me.requery in the first situation you have to refer to the subform by
refering to the parent first something like: forms!Mainform!subform.requery

where mainform is the name of your main form and subform is the name of your
subform.

hth
 
Back
Top