Subform Requery Criteria

M

Mackster66

MS Access 2010 FE, SQL Server 2005 BE

I have a form "MAINFORM" which uses Access Navigation Control. I have several forms with subforms in the Navigation Control pages. I also use popup forms to add new records to related tables. I want to update the forms/subforms whenever a popup form is closed. I created a button with the following VBA code:

DoCmd.Close acForm, "formADDINFORMATION"
Forms!MAINFORM.NavigationSubform.Requery

The problem is, when the form being updated required the user to enter criteria when opening, the Requery causes the form to request the user to entercriteria again. I would like the form to Requery using the previously entered criteria. Is there a way to specify criteria in the Requery command? If not, does anyone have any clever workarounds that they have used?
 
G

Gloops

Mackster66 wrote, on 31st July 2012 21:13 UTC + 1 :
MS Access 2010 FE, SQL Server 2005 BE

I have a form "MAINFORM" which uses Access Navigation Control. I have several forms with subforms in the Navigation Control pages. I also use popup forms to add new records to related tables. I want to update the forms/subforms whenever a popup form is closed. I created a button with the following VBA code:

DoCmd.Close acForm, "formADDINFORMATION"
Forms!MAINFORM.NavigationSubform.Requery

The problem is, when the form being updated required the user to enter criteria when opening, the Requery causes the form to request the user to enter criteria again. I would like the form to Requery using the previously entered criteria. Is there a way to specify criteria in the Requery command? If not, does anyone have any clever workarounds that they have used?

Hello,

The syntax is

Forms("MainForm").Subformcontrol.Form.Requery

So as I understood you replace Subformcontrol by NavigationSubform, as
it is the name of the control that contains the subform.

As you did I am not sure what the answer is (I answer from a place where
I do not have Access) but anyway as something misses it is quite
possible the user is required to precise something. I should not have
been surprised to meet an error 91, object missing.
 

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