J
JNariss
Hello,
I have a form in my database called "Approval Form". When someone fills
out the form and clicks submit it uses the SendObject command to send
an email notifying someone that the form has been filled out.
On that form is a # called Request ID. This number is originally in my
table called Request. I am trying to use a recordset to populate my
email with the specific Request ID so the person who receives the email
knows which Request ID has been Approved.
I first received the error 3601 Too few parameters. Expected 1 and now
I am receiving some error telling me: can't find form 'Approval_Form'
referred to in a macro expression or Visual Basic code.
I have no idea what to do now. The code I am using is:
Private Sub Submit_Approval_Click()
Dim strTo As String
Dim strRequest_ID As String
Dim strMessage As String
Dim db As DAO.Database
Dim rst As DAO.Recordset
Set db = CurrentDb
Set rst = db.OpenRecordset("SELECT * From Request WHERE [Request_ID]" &
" = " & Forms!Approval_Form!Request_ID & ";")
strRequest = rst![Request_ID]
strTo = "(e-mail address removed)"
strMessage = "You have been choosen as the Analyst for a System Change
Request. Please go to the database at
\\egsrosintra1\d$\Database\SystemChangeRequest.mdb and choose Reports -
View By --> View By Request ID" & Chr$(13) & Chr$(13) & _
"Request ID: " & strRequest & Chr$(13) & Chr$(13) & _
"Please do not reply to this automated email."
DoCmd.SendObject acSendNoObject, , , strTo, , , "Analyst Assigned",
strMessage, No, False
DoCmd.Close acForm, "Approval Form", acSaveYes
MsgBox "You have notified the Analyst that he/she has been assigned to
a Request and to go to the database to view it.", vbOKOnly, "Analyst
Assigned"
End Sub
If anyone knows how I can fix this I would truly appreciate it.
Thanks,
Justine
I have a form in my database called "Approval Form". When someone fills
out the form and clicks submit it uses the SendObject command to send
an email notifying someone that the form has been filled out.
On that form is a # called Request ID. This number is originally in my
table called Request. I am trying to use a recordset to populate my
email with the specific Request ID so the person who receives the email
knows which Request ID has been Approved.
I first received the error 3601 Too few parameters. Expected 1 and now
I am receiving some error telling me: can't find form 'Approval_Form'
referred to in a macro expression or Visual Basic code.
I have no idea what to do now. The code I am using is:
Private Sub Submit_Approval_Click()
Dim strTo As String
Dim strRequest_ID As String
Dim strMessage As String
Dim db As DAO.Database
Dim rst As DAO.Recordset
Set db = CurrentDb
Set rst = db.OpenRecordset("SELECT * From Request WHERE [Request_ID]" &
" = " & Forms!Approval_Form!Request_ID & ";")
strRequest = rst![Request_ID]
strTo = "(e-mail address removed)"
strMessage = "You have been choosen as the Analyst for a System Change
Request. Please go to the database at
\\egsrosintra1\d$\Database\SystemChangeRequest.mdb and choose Reports -
View By --> View By Request ID" & Chr$(13) & Chr$(13) & _
"Request ID: " & strRequest & Chr$(13) & Chr$(13) & _
"Please do not reply to this automated email."
DoCmd.SendObject acSendNoObject, , , strTo, , , "Analyst Assigned",
strMessage, No, False
DoCmd.Close acForm, "Approval Form", acSaveYes
MsgBox "You have notified the Analyst that he/she has been assigned to
a Request and to go to the database to view it.", vbOKOnly, "Analyst
Assigned"
End Sub
If anyone knows how I can fix this I would truly appreciate it.
Thanks,
Justine