Solved

How to requery a form which is on another form

Posted on 2014-11-10
3
563 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 36

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 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 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

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

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

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

763 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