?
Solved

Passing subform values to a parameter query

Posted on 2004-10-01
2
Medium Priority
?
224 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 200 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
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, when working with VBA, learn some techniques for writing readable and easily maintained code.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

650 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