Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

navigation form and report query question

Status
Not open for further replies.

Lhuffst

Programmer
Jun 23, 2003
503
0
0
US
Hi. I have a question regarding access navigation forms and reports.

I have a form [frmreports] that has 2 text boxes. txtdatefrom and txtdateto
in the report query, I use
Code:
Between [Forms]![frmReports]![txtfromdate] And [Forms]![frmReports]![txtToDate]

Running the reports directly from the reports form works fine.
I added a navigation form to the project using Forms Navigation option.

Now when I try to run the reports above, it is making me put in the dates again
Does the navigation page treat the forms as a subform?
Thinking this, I tried to change the query code to
Code:
Between Forms![Shop Operations Navigation].frmReports.Form.txtdatefrom and Forms![Shop Operations Navigation].frmReports.Form.txttoDate

But it still prompts me for the dates.
Help :)
Thanks
lhuffst
 
The obvious thing is that in the working code your field is

txtfromdate

and in the errant code the field is

txtdatefrom

Hope this helps!

There's always more than one way to skin a cat!

All posts/responses based on Access 2003/2007
 
Thanks for the response. I caught that after I posted but still had the same problem.
On the reports:
I ended up putting the from and to dates in a global variable and used them in LABELS instead of textbox on the report.

On the query:
I changed the do cmd to include a where clause instead of having it in each query itself.

All seems well now :)
Thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top