?
Solved

How to requery a form which is on another form

Posted on 2014-11-10
3
Medium Priority
?
702 Views
Last Modified: 2014-11-10
I have a form on which I set a range of criteria and I have three queries which use those criteria to select three sets of data from a table named tblTasks. I created three forms based on these three queries and added them to the main selection form.
I added a "Update Results" control to the main form.
My problem is now to program the "Update Results" control to update the three embedded forms on the main form.

The main form is "frmTasksSelect"
The other three forms are frmTasksInArrears, frmTasksForToday and frmTasksForFuture (They are copies of each other, but are based on different queries.) The queries gives the correct results.

One way that I tried was:

Forms![frmTasksSelect]![frmTasksInArrears].Requery
Forms![frmTasksSelect]![frmTasksForToday].Requery
Forms![frmTasksSelect]![frmTasksForFuture].Requery

Open in new window



I keep on getting error messages like "can't find the field 'frmTasksInArrears' referred to in your expression.
However the second line does not give that error.

I have checked the names over and over.

When I open the forms seperately they work fine. I just can't get them to update (requery) while they are embedded on the main form.

Can you see any problem?
0
Comment
Question by:Fritz Paul
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 38

Expert Comment

by:PatHartman
ID: 40432932
Include the .Form property in the reference.
Forms![frmTasksSelect].Form![frmTasksInArrears].Requery
Forms![frmTasksSelect].Form![frmTasksForToday].Requery
Forms![frmTasksSelect].Form![frmTasksForFuture].Requery

Open in new window

0
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 2000 total points
ID: 40432939
Also be sure that you've got the names of the Subform CONTROLS correct. Depending on how you embed the form, Access will name the Subform Control differently.

If you drag a Subform control to the form, and then set the SourceObject in the designer, then Access will name it something like "SubformControl1".

If you drag/drop a form onto another form, Access will add the Subform Control, and will generally name it to match the name of the Form being used as a Subform.
0
 

Author Closing Comment

by:Fritz Paul
ID: 40432992
Scott thanks, the "source object" was correct, but it was the "Name" that was skew. Thanks for the advice. I wasted so much time on this issue. I did check the "source object", but did not consider the Name.
I love EE.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question