G
Guest
Hi, I have a form with a command button to print a report called "amy2" the
user may fill out 1 to many forms for any given day. an "amy2" report will
print a report grouped by date.. I have this code in the on click event. but
it prints all report for every day.. the date header has a field called
dat by day and prints the date in long format eg Monday January 3, 2005. on
the form we use the short format eg. 1/3/2005. I tried puting in the same
field [date] that the form populates in the table. but still print all
reports. can someone tell me what i am missing.
Private Sub Printamy2_Click()
On Error GoTo Err_Printamy2_Click
Dim strDocName As String
Dim strWhere As String
Me.Refresh
strDocName = "amy2"
strWhere = "[date]=" & Me!Date
DoCmd.OpenReport strDocName, acNormal
Exit_Printamy2_Click:
Exit Sub
Err_Printamy2_Click:
MsgBox Err.Description
Resume Exit_Printamy2_Click
End Sub
user may fill out 1 to many forms for any given day. an "amy2" report will
print a report grouped by date.. I have this code in the on click event. but
it prints all report for every day.. the date header has a field called
dat by day and prints the date in long format eg Monday January 3, 2005. on
the form we use the short format eg. 1/3/2005. I tried puting in the same
field [date] that the form populates in the table. but still print all
reports. can someone tell me what i am missing.
Private Sub Printamy2_Click()
On Error GoTo Err_Printamy2_Click
Dim strDocName As String
Dim strWhere As String
Me.Refresh
strDocName = "amy2"
strWhere = "[date]=" & Me!Date
DoCmd.OpenReport strDocName, acNormal
Exit_Printamy2_Click:
Exit Sub
Err_Printamy2_Click:
MsgBox Err.Description
Resume Exit_Printamy2_Click
End Sub