I'm working with a command button that e-mails an Access report when clicked (see its syntax below). The button caption says "Click here to submit your request." I've just added code so that
after the form has been worked the button's caption says "RESUBMIT YOUR REQUEST."
---
So what I need to do is have the strSubject = "RESUBMITTED REQUEST#" & Forms![RequestForm]![ID] if the button's caption = "RESUBMIT YOUR REQUEST".
And if the button's caption = "Click here to submit your request.", strSubject should then = "New Ad Hoc Report Request #" & Forms![RequestForm]![ID]
Does this make sense? How can this be accomplished? Thanks for your help.
--
Private Sub Submit_Click()
On Error GoTo Err_submit_Click
Dim stDocName As String
Dim strOutputFormat As String
Dim strRecipName As String
Dim strSubject As String
Dim strCCName As String
stDocName = "ReportRequest"
strOutputFormat = "Snapshot Format"
strRecipName = "someone@somewhere.com"
strSubject = "New Ad Hoc Report Request #" & Forms![RequestForm]![ID]
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.SendObject acSendReport, stDocName, strOutputFormat, strRecipName, , , strSubject
DoCmd.Quit
Exit_submit_Click:
Exit Sub
Err_submit_Click:
MsgBox Err.Description
Resume Exit_submit_Click
End Sub
after the form has been worked the button's caption says "RESUBMIT YOUR REQUEST."
---
So what I need to do is have the strSubject = "RESUBMITTED REQUEST#" & Forms![RequestForm]![ID] if the button's caption = "RESUBMIT YOUR REQUEST".
And if the button's caption = "Click here to submit your request.", strSubject should then = "New Ad Hoc Report Request #" & Forms![RequestForm]![ID]
Does this make sense? How can this be accomplished? Thanks for your help.
--
Private Sub Submit_Click()
On Error GoTo Err_submit_Click
Dim stDocName As String
Dim strOutputFormat As String
Dim strRecipName As String
Dim strSubject As String
Dim strCCName As String
stDocName = "ReportRequest"
strOutputFormat = "Snapshot Format"
strRecipName = "someone@somewhere.com"
strSubject = "New Ad Hoc Report Request #" & Forms![RequestForm]![ID]
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
DoCmd.SendObject acSendReport, stDocName, strOutputFormat, strRecipName, , , strSubject
DoCmd.Quit
Exit_submit_Click:
Exit Sub
Err_submit_Click:
MsgBox Err.Description
Resume Exit_submit_Click
End Sub