Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing Report Criteria on Header 1

Status
Not open for further replies.

RowenaB

Programmer
May 28, 2003
8
GB
Hi,

I have a report which is run on a union query based on another query.

The second query has the following parameter for a date criteria

between [Enter Start Date] and [Enter To Date]

I would like to show this on the Report Header. I have created a text box on the Header Band called DateRange and tried the following code but it does not work - tells me it cannot find the field [Enter Start Date].
Is this possibly because the parameter is not in the initial query but in the second query?

Private Sub PageHeader_Print(Cancel As Integer, PrintCount As Integer)
Let Report_AllocatedCosts.DateRange = [Enter Start Date]
End Sub

I also tried to do it differently ....
Private Sub PageHeader_Print(Cancel As Integer, PrintCount As Integer)
Let Report_AllocatedCosts.DateRange = "From " & [Enter Start Date] & " and " & [Enter To Date]
End Sub

and even ....

Private Sub PageHeader_Print(Cancel As Integer, PrintCount As Integer)
Let Report_AllocatedCosts.DateRange = "From " & Cstr([Enter Start Date]) & " and " & CStr([Enter To Date])
End Sub

But am having absolutely no luck.

Any suggestions would be appreciated.

Thanks
Rowena
 
In your DateRange text box, set its control source to be something like this:
Code:
"From " & [Enter Start Date] & " to " & [Enter To Date]


Hoc nomen meum verum non est.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top