How to refresh form view

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a form with controls on it and a subform. The subform record source is
a query. The contols initiate code and alter the query. I use Requery to
update the form. However to get the final resuls I have to change the form to
design view and then back again. When I do this the correct results are
shown. How can I do this without changing to design view and back again?
 
How do you issue the Requery?

Access does not change the Value of an unbound control until you exit it.
So, if the focus is still in the text box where you entered the criteria,
and the query is reading the value from that text box, it won't discover the
new value. Adding a command button to perform the requery would solve that,
because the focus has to leave the text box to get to the command button, so
the Value would be updated.

For an alternative approach, see:
Search form
at:
http://allenbrowne.com/ser-62.html
The article explains how to create a search form based on only the controls
where the user enters criteria, handling different field types. Includes
sample database to download.
 
Back
Top