2 queries, a date range and a report?!

S

Sarella

I'm pretty much a novice access user, and am designing my DB with the
frequent assistance of these forums. However I'm now trying to do something
that I can't find any reference to - Can anyone advise?

I have a report that is to be printed from a form using a print control
button. The report consists of 2 queries which look up 2 different types of
"item" by date range.

I want to be able to prompt the user once for the start and end date. If I
put a start/end request on both of the queries, then the user has to enter
the dates twice, and when you choose the printer, it asks twice more. Is
there a way to view/print the report but only enter the date range once?

If you can answer, please be as basic as possible!

Many thanks
 
S

Steve

Set up your form so you can enter the dates on the form. Either use
textboxes or calendar controls. Then in the criteria of your queries use the
expression:
Between Forms!NameOfYourForm!NameOfStartDateField And
Forms!NameOfYourForm!NameOfEndDateField

Steve
(e-mail address removed)
 
S

Sarella

Hi Steve,

I've done exactly as you suggested. Created a form, with 2 text boxes for
dates (another couple for customer and ID etc too) then put both my queries
on the form as sub forms. I've inserted Between Forms![DW Form]![From Date]
And
Forms![DW Form]![To Date] into the criteria of both queries in the date
column, however it doesn't seem to work. No data is displayed either before
or after entering dates in the text boxes. Is there something else I'm
missing?

Many many thanks

Sarella
 
S

Steve

Go to your queries and one at a time run each query. Access will ask you for
the From Date and the To Date; entr them. Does the query return any records?

Steve


Sarella said:
Hi Steve,

I've done exactly as you suggested. Created a form, with 2 text boxes for
dates (another couple for customer and ID etc too) then put both my
queries
on the form as sub forms. I've inserted Between Forms![DW Form]![From
Date]
And
Forms![DW Form]![To Date] into the criteria of both queries in the date
column, however it doesn't seem to work. No data is displayed either
before
or after entering dates in the text boxes. Is there something else I'm
missing?

Many many thanks

Sarella

Steve said:
Set up your form so you can enter the dates on the form. Either use
textboxes or calendar controls. Then in the criteria of your queries use
the
expression:
Between Forms!NameOfYourForm!NameOfStartDateField And
Forms!NameOfYourForm!NameOfEndDateField

Steve
(e-mail address removed)




.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top