P
Peter
Hi,
I have a form that uses a button to bring up a report. Basically on the
form there are two fields, start date and end date.
The user fills in these 2 fields and the report shows the meal allowances
for employees within the range of the 2 dates entered.
The result was successfull, but I was wondering how do I pass these 2
variables to the report's page header? I want the page header to display
"Report between startdate and enddate".
The code that I used in shown below.
Thanks.
Peter
Private Sub Command5_Click()
On Error GoTo Err_Command5_Click
Dim strFilter As String
DoCmd.OpenReport "rptMeal", View:=acPreview
Set rpt = Reports("rptMeal")
rpt.FilterOn = True
rpt.Filter = "[IN_WRK_DATE] BETWEEN #" & Format(txtDate1,
"mm\/dd\/yyyy") & "# AND #" & Format(txtDate2, "mm\/dd\/yyyy") & "#"
Exit_Command5_Click:
Exit Sub
Err_Command5_Click:
MsgBox Err.Description
Resume Exit_Command5_Click
End Sub
I have a form that uses a button to bring up a report. Basically on the
form there are two fields, start date and end date.
The user fills in these 2 fields and the report shows the meal allowances
for employees within the range of the 2 dates entered.
The result was successfull, but I was wondering how do I pass these 2
variables to the report's page header? I want the page header to display
"Report between startdate and enddate".
The code that I used in shown below.
Thanks.
Peter
Private Sub Command5_Click()
On Error GoTo Err_Command5_Click
Dim strFilter As String
DoCmd.OpenReport "rptMeal", View:=acPreview
Set rpt = Reports("rptMeal")
rpt.FilterOn = True
rpt.Filter = "[IN_WRK_DATE] BETWEEN #" & Format(txtDate1,
"mm\/dd\/yyyy") & "# AND #" & Format(txtDate2, "mm\/dd\/yyyy") & "#"
Exit_Command5_Click:
Exit Sub
Err_Command5_Click:
MsgBox Err.Description
Resume Exit_Command5_Click
End Sub