I have a report that needs to be emailed. I have set the preview report button and print report button, with the criteria from a calendar. The criteria being the week ending date the users chooses.
The preview and print both work, but I can't find where to enter the criteria in code to email only the week ending. Is there a way other than choosing File....Send (as attachment), Snapshot format?
I don't want to explain that with each user (novice users).
THe code I used for the preview is:
Private Sub btnPreview_Click()
On Error GoTo Err_btnPreview_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim r As Form
stDocName = "RptBasicTImeEntryAudit"
stLinkCriteria = " WorkDate BETWEEN #" & Me.txtStartDate & "# AND #" & Me.txtEndDate & "#"
DoCmd.OpenReport stDocName, acViewPreview, , stLinkCriteria, , Me.txtEndDate
'Reports!QryTImeEntryAudit!PayPdEndDate = Me.txtEndDate.Value
Exit_btnPreview_Click:
Exit Sub
Err_btnPreview_Click:
MsgBox Err.Description
Resume Exit_btnPreview_Click
End Sub
Thanks Bailey11
The preview and print both work, but I can't find where to enter the criteria in code to email only the week ending. Is there a way other than choosing File....Send (as attachment), Snapshot format?
I don't want to explain that with each user (novice users).
THe code I used for the preview is:
Private Sub btnPreview_Click()
On Error GoTo Err_btnPreview_Click
Dim stDocName As String
Dim stLinkCriteria As String
Dim r As Form
stDocName = "RptBasicTImeEntryAudit"
stLinkCriteria = " WorkDate BETWEEN #" & Me.txtStartDate & "# AND #" & Me.txtEndDate & "#"
DoCmd.OpenReport stDocName, acViewPreview, , stLinkCriteria, , Me.txtEndDate
'Reports!QryTImeEntryAudit!PayPdEndDate = Me.txtEndDate.Value
Exit_btnPreview_Click:
Exit Sub
Err_btnPreview_Click:
MsgBox Err.Description
Resume Exit_btnPreview_Click
End Sub
Thanks Bailey11