O
O Wilson
Hello,
I have a form call "Daily Reports" which the user fills
out daily. I also have report that needs to be printed
daily.
I have a command button that opens the report in Print
Preview but it show reports for all the days. I'd like
to get it to open the report containing only the
information for a specific date; the date diplayed in the
form. My code, as is, looks like this:
Private Sub Command195_Click()
On Error GoTo Err_Command195_Click
Dim stDocName As String
Dim strFilter As String
stDocName = "Daily Manpower and Manhour Report"
strFilter = "Date = Forms!Daily Manpower and Manhour
Report!Date"
DoCmd.OpenReport stDocName, acPreview, , strFilter
Exit_Command195_Click:
Exit Sub
Err_Command195_Click:
MsgBox Err.Description
Resume Exit_Command195_Click
End Sub
This format works with other kinds of data but I cannot
get it to work using dates. Any suggestions would be
greatly appreciated.
TIA
Owen
I have a form call "Daily Reports" which the user fills
out daily. I also have report that needs to be printed
daily.
I have a command button that opens the report in Print
Preview but it show reports for all the days. I'd like
to get it to open the report containing only the
information for a specific date; the date diplayed in the
form. My code, as is, looks like this:
Private Sub Command195_Click()
On Error GoTo Err_Command195_Click
Dim stDocName As String
Dim strFilter As String
stDocName = "Daily Manpower and Manhour Report"
strFilter = "Date = Forms!Daily Manpower and Manhour
Report!Date"
DoCmd.OpenReport stDocName, acPreview, , strFilter
Exit_Command195_Click:
Exit Sub
Err_Command195_Click:
MsgBox Err.Description
Resume Exit_Command195_Click
End Sub
This format works with other kinds of data but I cannot
get it to work using dates. Any suggestions would be
greatly appreciated.
TIA
Owen