By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,302 Members | 3,621 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,302 IT Pros & Developers. It's quick & easy.

Subform refresh or requery??

P: n/a
Hi everyone,

I have been updating a file that uses a main form that contains a
subform (as a datasheet). The main form really does not do anything
on opening except maximizes to the users screen size. The subform
however runs an "embedded" query (cause I don't know the right term)
to show a list of records based on the embedded query. BTW, by
embedded, I'm indicating the form does not run an external query but
uses the query included as part of the forms design.

Anyway, for some reason the subforms query occasionally generates an
error message telling me that the data cannot be found when the file
is opened. When clicking OK, the main form/subform comes up but the
subform section is a blank white screen. However, when I open two
forms that use the same data source the subforms query uses, both
forms work fine and I can then open the main form/subform again and
work away merrily.
>From reading this newsgroup, it appears that the use of either requery
or refresh may help when the file opens. What i really would like to
understand better is which one is the better option to ensure the
query runs after the main form loads. From digging, it appears the
subform may try to load before the main form does. My reading of this
group seems to be indicating I need to have a separate query in order
to get either option to run. Do I simply need an stand alone query to
run? Do I even need either option? Am I looking at the wrong option?

Any help would be appreciated.

Regards,

Stinky Pete

Feb 5 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Feb 5, 5:43 am, "Stinky Pete" <Peter.Mor...@symbionhealth.com>
wrote:
Hi everyone,

I have been updating a file that uses a main form that contains a
subform (as a datasheet). The main form really does not do anything
on opening except maximizes to the users screen size. The subform
however runs an "embedded" query (cause I don't know the right term)
to show a list of records based on the embedded query. BTW, by
embedded, I'm indicating the form does not run an external query but
uses the query included as part of the forms design.

Anyway, for some reason the subforms query occasionally generates an
error message telling me that the data cannot be found when the file
is opened. When clicking OK, the main form/subform comes up but the
subform section is a blank white screen. However, when I open two
forms that use the same data source the subforms query uses, both
forms work fine and I can then open the main form/subform again and
work away merrily.
From reading this newsgroup, it appears that the use of either requery

or refresh may help when the file opens. What i really would like to
understand better is which one is the better option to ensure the
query runs after the main form loads. From digging, it appears the
subform may try to load before the main form does. My reading of this
group seems to be indicating I need to have a separate query in order
to get either option to run. Do I simply need an stand alone query to
run? Do I even need either option? Am I looking at the wrong option?

Any help would be appreciated.

Regards,

Stinky Pete
My first thought is that your subform's query is referencing a value
in one of the forms in a "WHERE" clause of some sort.

My second thought is that you can always apply a query later with the
Filter and FilterOn method.

My third thought is that, usually, a subform and a form are related in
the properties of the subform, and that they try to link data in the
subform to data in the form. If you have a link there, but no data on
the main form, possibly that's the source of your issue.

Pasting your query's SQL code might be a start to getting a real
answer.

Jon

Feb 5 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.