Hi,
Here is my code:
As you can see the users enters a date into an input box - this is a parameter in the query 'UnionPayCyclesAll'. This works fine - it creates the recordset fine. But how do I open the report based on this recordset. When I run the code above - it asks me for the [Weekend] parameter again at the line
DoCmd.OpenReport "Pay Report", acPreview
I just want the user to enter the date once into the input box and for the report to open?
Here is my code:
Code:
WeekEndDate = CDate(Format(InputBox("Please enter the weekend date.", "Enter weekend date"), "long date"))
Set qdefPayReport = CurrentDb.QueryDefs("UnionPayCyclesAll")
qdefPayReport.Parameters("Weekend") = WeekEndDate
Set rsPayreport = qdefPayReport.OpenRecordset()
DoCmd.OpenReport "Pay Report", acPreview
As you can see the users enters a date into an input box - this is a parameter in the query 'UnionPayCyclesAll'. This works fine - it creates the recordset fine. But how do I open the report based on this recordset. When I run the code above - it asks me for the [Weekend] parameter again at the line
DoCmd.OpenReport "Pay Report", acPreview
I just want the user to enter the date once into the input box and for the report to open?