Smart label maybe?

Scadadude

New member
Local time
Today, 01:32
Joined
Nov 12, 2008
Messages
9
I am running a report based off a query and my query prompts me for a First Date and End Date for it to know what time frame I am looking for. How can I show on my report the dates that I put in for the query. It isnt a constant date so I am puzzled.

Thanks

Scadadude
 
create a form with the start and end date boxes then run the query based off of those. Then reference them in the report by creating a txtbox whose control source is

=forms!frmname.controlname
 
I did the following and now the database crashes everytime I try to access the report or even delete the report

Create a form (call it SelectDates) and put 2 unbound text boxes on it. Call them txtStart and txtEnd. Then go to each of the queries and put the following as the criteria for your date fields:

BETWEEN Forms![SelectDates]![txtStart AND Forms![SelectDates]![txtEnd].

Next put a Command button on your form to run your report. In the report put 2 unbound text boxes where you want the dates to appear. I usually put them in the report header. In the first box, I make the DataSource; =Forms![SelectDates]![txtStart] set the label to "From". In the second box I make the DataSource; =Forms![SelectDates]![txtEnd] and make the label "To".

Now, when you open that form, you enter the dates just once and each query pulls the dates from the form and they show up on the report
 
Hi,

You don't need to base it on a form, you can get the data information directly from the query as follows:

Now I am assuming that you have two fields one known as your FirstDate and the other known as your LastDate in your query. I also assume that you have in the criteria below each field something like [Enter First Date] and [Enter Last Date], which prompts for the date range you require.

Now in the report create two unbound text boxes and name them FirstDate and LastDate, in the source section of the properties for each of these boxes type in [Enter First Date] and [Enter Last Date], save your report and run it, now each time your run that report the dates you specified will appear in your report where you have positioned these unbound text boxes.

I know it works because I do that currently with some of my reports.

good luck.

John
 

Users who are viewing this thread

Back
Top Bottom