Solved

Passing subform values to a parameter query

Posted on 2004-10-01
2
219 Views
Last Modified: 2008-02-20
I have a subform that passes two dates into a criteria expression in my query. I keep getting prompted for parameter entries for both dates.

These are the forms I'm using...

frmReports: is the main form
frmSubReports: is the name of the subform control on the main form
frmSubReportsDates: is the name of the subform that is called and appears in the the subform control
ctrFromDate and ctrToDate: the names of the DTPicker controls contained in frmSubReportsDates

Originally, I was testing with just the subform and everything seemed ok.

I used this...

Between [Forms]![frmSubReportsDates].[ctrFromDate] And [Forms]![frmSubReportsDates].[ctrToDate]

Once I opened up the main form containing the subform then I started to receive the prompts asking to enter parameter values.

I have since modified the query expession to this...

Between [forms]![frmReports].[frmSubFormReports].[Form]![frmSubReportsDates].[ctrFromDate] And [forms]![frmReports].[frmSubFormReports].[Form]![frmSubReportsDates].[ctrToDate]

This is where I'm stuck. Any suggestions?

0
Comment
Question by:JakeB52
[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
2 Comments
 
LVL 39

Accepted Solution

by:
stevbe earned 50 total points
ID: 12202075
[forms]![frmReports].[frmSubFormReports].[Form]![frmSubReportsDates].[ctrFromDate]

you need to use the name of the subform control and not the name of the embedded form

[Forms]![frmReports].[childReports].[Form].[childDates].[Form].[ctrFromDate]

check the . and ! s

Steve
0
 

Author Comment

by:JakeB52
ID: 12297527
Oops! I forgot to follow up on this thread.

Steve, your suggestion pointed me in the right direction.

The final solution was as follows:

Between [Forms]![frmReports]![ChildReports].[Form]![ctrFromDate] And [Forms]![frmReports]![ChildReports].[Form]![ctrToDate]

Thanks for your help.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

738 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