I have created a database where I will need to send specific records to managers via email which I need to use to collect data. I presently can send an entire table but would like to know how to set this up for individual records.
I have created a database where I will need to send specific records to managers via email which I need to use to collect data. I presently can send an entire table but would like to know how to set this up for individual records.
Does your table have a primary key? (auto number field for instance)
If so you can select the record from, say, a list box then export the single selected record. If you don't have a PK in your table it becomes somewhat more problematic.
Are you looking to include the data from the single record in the body of the email or as an attachment, like a text file or excel file?
You can open a report filtered first:
BaldyWeb - Autofill
Then email it with SendObject, or use this to filter it from within:
Emailing a different report to each recipient
After you decide how you will filter/select/find the record, here is a snippit to send an attachment based upon a report. You would use strWhere as your where criteria.
Code:Dim strSubject As String Dim strBody As String Dim strReport As String Dim strTo As String Dim strCc As String Dim strBcc As String strSubject = "Insert Subject Line Here" strBody = "Insert text to be displayed in the email body" strReport = "ReportName" strTo = "you@gmail.com" strCc = "" strBcc = "me@gmail.com" On Error GoTo Error_Email DoCmd.OpenReport "strReport", acViewPreview, , strWhere DoCmd.SelectObject acReport, "strReport", False DoCmd.SendObject acSendReport, strReport, acFormatPDF, strTo, strCc, strBcc, strSubject, strBody, True DoCmd.Close acReport, "strReport" Exit_MySub: Exit Sub Error_Email: MsgBox "There was an error. Perhaps you cancelled the Email." Resume Exit_MySub
I am looking to export a record as a form in outlook. Presently I can only export all the records in the table. I do have a primary key associated with each record.Does your table have a primary key? (auto number field for instance)
If so you can select the record from, say, a list box then export the single selected record. If you don't have a PK in your table it becomes somewhat more problematic.
Are you looking to include the data from the single record in the body of the email or as an attachment, like a text file or excel file?
Try using this:
http://msdn.microsoft.com/en-us/libr.../ff197046.aspx
I didn't work an example but it seems like you should be able to mail the form directly to someone.
Thank you all so much for your help