kimmer7389
Technical User
On a form I have 2 buttons. I would like for the the first button to allow users to e-mail a report based on the ID number of the form. I would like for the other button to allow them to save a report based on the criteria of the form.
This is the code I am trying to use to Save the report from the form.
Private Sub cmdSave1_Click()
On Error GoTo Err_cmdSave1_Click
Dim strwhere As String
strwhere = "[bsdirID] = " & bsdirID
Dim stDocName As String
stDocName = "rptBattleStaffDirectives"
DoCmd.OutputTo acOutputReport, stDocName, acFormatSNP, strwhere
Exit_cmdSave1_Click:
Exit Sub
Err_cmdSave1_Click:
MsgBox Err.Description
Resume Exit_cmdSave1_Click
End Sub
This code dosen't work. I don't have the strwhere in the right place. I am not even sure if I am even close to making this work right.
Please Help.
This is the code I am trying to use to Save the report from the form.
Private Sub cmdSave1_Click()
On Error GoTo Err_cmdSave1_Click
Dim strwhere As String
strwhere = "[bsdirID] = " & bsdirID
Dim stDocName As String
stDocName = "rptBattleStaffDirectives"
DoCmd.OutputTo acOutputReport, stDocName, acFormatSNP, strwhere
Exit_cmdSave1_Click:
Exit Sub
Err_cmdSave1_Click:
MsgBox Err.Description
Resume Exit_cmdSave1_Click
End Sub
This code dosen't work. I don't have the strwhere in the right place. I am not even sure if I am even close to making this work right.
Please Help.