View Full Version : Not sure how to show date range


Lancer
05-15-2007, 01:47 AM
I've added a new report to a simple business type database. My report (useage by crop report) asks a user for start and finish dates for a time they want to see outgoing costs... try inputting the dates 1 Jan 2005 and 1 Feb 2005 to get the idea. The form works but...

...how do I get it to put the chosen date range at the header of the report? (You can see I've left the link part blank). :confused:

Download the Access 2000 Database from: http://s11.quicksharing.com/v/2429992/smallshop.mdb.html
TinyURL download: http://www.tinyurl.com/22hgf8
Free file-hosting - sorry about the credit card adverts. :rolleyes:

Thanks in advance - Lancer.

Dennisk
05-15-2007, 01:51 AM
create a text box on your report Header/Page Header and set the control source to

=Forms!YourForm!YourDateControl

Lancer
05-15-2007, 02:25 AM
create a text box on your report Header/Page Header and set the control source to

=Forms!YourForm!YourDateControl

Yes, I'd tried that. Did you look at the database before answering? The "prompt" asking for the dates comes from the query. I'm not sure that it goes to a field, and if it does I'm not sure how to link to the field in the way you say.

...but then I'm not good at Access... could someone please give me some simple steps?

Brianwarnock
05-15-2007, 03:43 AM
Pretty sure that you cannot capture prompts therefore if you wish to capture your parameters you must use a form to input them, if this means redesigning your DB so be it.

Brian

Dennisk
05-15-2007, 03:46 AM
I am not allowed to download dbs. however you did mention a form so I assumed you had created a form to enter criteria, which is the normal way of doing thing rather than prompting the user via a query parameter.

Lancer
05-15-2007, 02:57 PM
Well, thanks to both of you. Problem solved by adding a form to ender the dates, no extra tables needed. Format was =[Forms]![MyForm]![MyDateControl].

I'll hit the scale icons on you both for your speedy replies.

EDIT: Sorry, did not know I could not hit scales on both of you... gave credit to Dennisk for the speedy reply.

pbaldy
05-15-2007, 03:04 PM
For the record, you can capture query prompts in the report. Simply use the same prompt in a textbox, like:

="Report for: " & [Enter date]

The key is it has to be exactly as in the query.