splats
Technical User
- Jan 2, 2003
- 131
Hello
Here's my code. Unfortunately, when the checkbox is clicked the code works, however, when I uncheck it, the code still tries to email the report rather than just show the report. Basically, the code is ignoring the fact that the checkbox's status is changed back to being unchecked. any input would be greatly appreciated. thank u
Private Sub CmdCostHrs_Click()
On Error GoTo Err_CmdCostHrs_Click
Dim stDocName As String
stDocName = "Costs and Hours Lost"
If IsNull(Me.ChkEmail) Then
DoCmd.OpenReport stDocName, acPreview
Else
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
'DoCmd.OpenReport stDocName, acPreview
DoCmd.SendObject acSendReport, stDocName, acFormatSNP, , , , "Chart Statistics By Cost and Hours", , True
End If
Exit_CmdCostHrs_Click:
Exit Sub
Err_CmdCostHrs_Click:
MsgBox Err.Description
Resume Exit_CmdCostHrs_Click
End Sub
Here's my code. Unfortunately, when the checkbox is clicked the code works, however, when I uncheck it, the code still tries to email the report rather than just show the report. Basically, the code is ignoring the fact that the checkbox's status is changed back to being unchecked. any input would be greatly appreciated. thank u
Private Sub CmdCostHrs_Click()
On Error GoTo Err_CmdCostHrs_Click
Dim stDocName As String
stDocName = "Costs and Hours Lost"
If IsNull(Me.ChkEmail) Then
DoCmd.OpenReport stDocName, acPreview
Else
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
'DoCmd.OpenReport stDocName, acPreview
DoCmd.SendObject acSendReport, stDocName, acFormatSNP, , , , "Chart Statistics By Cost and Hours", , True
End If
Exit_CmdCostHrs_Click:
Exit Sub
Err_CmdCostHrs_Click:
MsgBox Err.Description
Resume Exit_CmdCostHrs_Click
End Sub