Subform Refresh

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
 
M

Maurice

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
 

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