Report Printing ( Dates Specified)

G

Guest

I have created a buytton to print a report based on user input.

I know how to create the button and macro to open the report
I have created a report based on a query that slects the records between the
dates the user inputed in the prompt.

Now what I want to do is add on the top of the report the dates the user
inputed

Such as saying Records for 01/01/01 to 01/01/02

How would I go about this?
Thanks,
Greg
 
G

Guest

If the form is still loaded then you can use in the text box controlsource
within the report

="Dates are between " & Forms![FormName]![StartDateTextBox] & " And " &
Forms![FormName]![EndDateTextBox]
 
Z

zionsaal

I have created a buytton to print a report based on user input.

I know how to create the button and macro to open the report
I have created a report based on a query that slects the records between the
dates the user inputed in the prompt.

Now what I want to do is add on the top of the report the dates the user
inputed

Such as saying Records for 01/01/01 to 01/01/02

How would I go about this?
Thanks,
Greg

openArgs wold be the best way
DoCmd.OpenReport "report name", acViewPreview, , , , your date criteria
 
G

Guest

That does not work.

I have the user inpuit in the query using the BETWEEN command

If there isn't a way to recall what they put in as paramaters
is there some code that will select the first record and last record and use
the dates that thoes indicate, since I have the report in accending order
based on the date.

Ofer Cohen said:
If the form is still loaded then you can use in the text box controlsource
within the report

="Dates are between " & Forms![FormName]![StartDateTextBox] & " And " &
Forms![FormName]![EndDateTextBox]

--
Good Luck
BS"D


GregB said:
I have created a buytton to print a report based on user input.

I know how to create the button and macro to open the report
I have created a report based on a query that slects the records between the
dates the user inputed in the prompt.

Now what I want to do is add on the top of the report the dates the user
inputed

Such as saying Records for 01/01/01 to 01/01/02

How would I go about this?
Thanks,
Greg
 
G

Guest

If the query recordsource has

Select from TableName Where DateFieldNAme Between [Please select start
date] And [Please select end date]

Then in the text box write

="Dates are between " & [Please select start date] & " And " &
[Please select end date]

If that not the case, so can you explain what do you ean by the user input
parameters

--
Good Luck
BS"D


GregB said:
That does not work.

I have the user inpuit in the query using the BETWEEN command

If there isn't a way to recall what they put in as paramaters
is there some code that will select the first record and last record and use
the dates that thoes indicate, since I have the report in accending order
based on the date.

Ofer Cohen said:
If the form is still loaded then you can use in the text box controlsource
within the report

="Dates are between " & Forms![FormName]![StartDateTextBox] & " And " &
Forms![FormName]![EndDateTextBox]

--
Good Luck
BS"D


GregB said:
I have created a buytton to print a report based on user input.

I know how to create the button and macro to open the report
I have created a report based on a query that slects the records between the
dates the user inputed in the prompt.

Now what I want to do is add on the top of the report the dates the user
inputed

Such as saying Records for 01/01/01 to 01/01/02

How would I go about this?
Thanks,
Greg
 
G

Guest

I would recommentd creating a form with the from and to dates to be entered
and a command button to print the report

to refer to fields on a form
in the control source of the from and to fileds on the report put
[Forms]![NameOfForm]![NameOfTextbox]

You can also use these date in the query
 

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