Printing date range on report (1 Viewer)

gilescis

D. Castaldo
Local time
Today, 13:34
Joined
Jan 23, 2006
Messages
106
I have a report that I want to pint the beginning date and ending date range that the report was based off of.
I have a query that prompts for begining date and ending date

I want the print to look like this.

Current Report Date : 01/01/06 to 01/30/06

Any Ideas

Thanks
Dean C
Giles Chemical
 

antomack

Registered User.
Local time
Today, 18:34
Joined
Jan 31, 2002
Messages
215
Add a new text box to the Report, remove it's label.

Set it's controlsource to
="Current Report Date : " & [Beginning Date?] & " to " & [End Date?]

Change 'Beginning Date?' and 'End Date?' text to your own prompt messages used in query
 

gilescis

D. Castaldo
Local time
Today, 13:34
Joined
Jan 23, 2006
Messages
106
I appreciate your quick response however I was able to get that to work except my report has a prompt field in it so when I run the report it prompts me twice for the same beg & ending date
 

ansentry

Access amateur
Local time
Tomorrow, 03:34
Joined
Jun 1, 2003
Messages
995
Open your report in design view and then put 2 unbound text boxes in the report header.

First Box name txtStartRange and enter source as =Min([NameofYourDateField])
Second Box name txtEndRange and enter source as =Max([NameofYourDateField])

Simple as that.
 

gilescis

D. Castaldo
Local time
Today, 13:34
Joined
Jan 23, 2006
Messages
106
Thanks John, That sort of worked except when I entered Begining 01/01/06 and 01/31/06 as ending, it prints 01/02/06 01/23/06
 

antomack

Registered User.
Local time
Today, 18:34
Joined
Jan 31, 2002
Messages
215
What I suggested should work fine, you should only get the one prompt for each of the values.

A way to ensure it works is to change your query so that it includes your parameter prompts as fields, name them appropriately. Then on the report set the controlsource of the current data field to refer to these 'field' names rather than the parameter prompts.
 

ansentry

Access amateur
Local time
Tomorrow, 03:34
Joined
Jun 1, 2003
Messages
995
Mine works fine for me, have a look at the attached sample. Just use the combo boxes to select the dates and then click the View Report button.
 
Last edited:

ansentry

Access amateur
Local time
Tomorrow, 03:34
Joined
Jun 1, 2003
Messages
995
Sorry, I did not read your first post correctly.

Hope this sample is what you want.
 
Last edited:

ansentry

Access amateur
Local time
Tomorrow, 03:34
Joined
Jun 1, 2003
Messages
995
Here is another sample the filtering is done in the query.
 
Last edited:

gilescis

D. Castaldo
Local time
Today, 13:34
Joined
Jan 23, 2006
Messages
106
John
The only prob there is I am not using an additional form to get the dates.
When they click on the link to run the report, it then prompts them for the begining data and ending date from the query, then returns the data

Maybe I am trying to go at this the wrong way...
 

ColinEssex

Old registered user
Local time
Today, 18:34
Joined
Feb 22, 2002
Messages
9,121
In the unbound textboxes in the report header you must have exactly the same wording as you have in the query prompts or you'll be prompted again.

Col
 

gilescis

D. Castaldo
Local time
Today, 13:34
Joined
Jan 23, 2006
Messages
106
Thks
I just figured that out.
I appreciate everyone's Help

One last question. If I have 2 copies of the MDB, 1 on the server for users to get to and 1 on my development pc, Can I make my neccessary changes on my development pc and just save the form, query, rpt to the other MDB without messing with the good working data ?
 

x0reset

Registered User.
Local time
Today, 10:34
Joined
Nov 14, 2005
Messages
52
Are you using a separate query or did you build the query in the data source of the report?

I would start by making sure the query is built in the data source of the report. Then add two parametric fields to the query:

StartDate: [Your first parameter prompt]
EndDate: [Your second parameter prompt]

Next, add the following criteria to the appropriate date field in your query:

Between [StartDate] And [EndDate]

Finally, create an unbound text box on your report with the following control source:

="From " & [StartDate] & " To " & [EndDate]

Edit- Looks like you got it just before I posted! To answer your last question, yes you can. After you have made the changes you want, open your working copy of the database, delete the forms, queries, and reports you have modified, then import them from your development copy. As long as they have the same table structure, they will work the same no matter how much data is in the tables.
 
Last edited:

gilescis

D. Castaldo
Local time
Today, 13:34
Joined
Jan 23, 2006
Messages
106
BTW DO I have to delete all the reports, forms, etc if I only make a change to 1 form or reprt etc.
 

x0reset

Registered User.
Local time
Today, 10:34
Joined
Nov 14, 2005
Messages
52
No, just delete and import the entities you modified.
 

Users who are viewing this thread

Top Bottom