I have searched for a few days and found older fixes to this problem but nothing that is current to my version of Access (365) or current to the type of code that i am working with.
I have used this site for a few questions with this database, and have had amazing results. i am learning to find my own answers and figuring out how to do this while i have a smarter than me person guiding me through.
I am working with a single table and two form database.
the first form fills out a request and submits to request through clicking the save button.
the second form works the request and puts in their own information followed by sending a confirmation email to the original requester.
here is a copy of the Sendobject code that i have for my second form:
Option Compare Database
Option Explicit
Expand|Select|Wrap|Line Numbers
- Private Sub cmd_save_Click()
- Dim strName As String
- Dim dtDate As Date
- Dim strEmail As String
- Dim strMessage As String
- Dim strmsa As String
- strName = Me.txt_prov_name
- dtDate = Me.txt_completion_date
- strEmail = Me.txt_prov_email
- strmsa = Me.txt_who
- strMessage = "Hello " & strName & "," & _
- vbCrLf & "Your request has been completed. Please review the changes made to your clinic and reply to this email if more changes are needed." & _
- "There is no need to reply if the changes are correct." & " " & "-" & strmsa
- Call DoCmd.SendObject(ObjectType:=acSendForm, _
- ObjectName:="Request - MSA", _
- OutputFormat:=acFormatPDF, _
- To:=strEmail, _
- Subject:="Clinic Change Request", _
- MessageText:=strMessage, _
- EditMessage:=True)
- End Sub
- Private Sub Form_Open(Cancel As Integer)
- Me.Filter = "[Work Completed By] is Null OR [Date Completed] is Null"
- Me.FilterOn = True
- End Sub
- Private Sub Form_Timer()
- MsgBox ("Refreshing Now, Press OK to continue")
- End Sub
the largest part uses the record information to send an email with a snapshot of the completed form to the original requester's email in a PDF format.
this worked just fine, until i had two requests to complete.
both were filtered to view in the second form and when i hit save, the PDF displayed both of them in the email.
what i need is for the PDF to only send the single record that i am working on.
i found ACformatSNP instead of PDF, but that did not work at all and broke the form when i hit save......
I read that i need to create a report based on the specific record that i am working on and then set that as the send object.
I know next to nothing about Access, except what others on this forum have helped me learn.....so Green, New and multiple other things that i am, i need just a little bit more help on this before i go live.
Please do NOT do this for me, please help point me in the right direction, and guide my hands to type the correct line of code, so I can learn.
Right now I am understanding that I need to create a report that shows the current record and i need to export that to PDF......I don't even know the first thing about report.
Guiding Hands please teach me what i need to know.