Link to home
Start Free TrialLog in
Avatar of JakeB52
JakeB52

asked on

Passing subform values to a parameter query

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?

ASKER CERTIFIED SOLUTION
Avatar of stevbe
stevbe

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JakeB52
JakeB52

ASKER

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.