Solved

Passing subform values to a parameter query

Posted on 2004-10-01
2
217 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
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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
In the previous article, Using a Critera Form to Filter Records (http://www.experts-exchange.com/A_6069.html), the form was basically a data container storing user input, which queries and other database objects could read. The form had to remain op…
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…
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 …

777 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