I have no background in scripting (barr HTML) and need some help with hashing out a VB script for a database I'm working on.
What my goal is, is to have a single record of a form which is the current focus emailed as PDF to a recipient. I am using Access 2007 and have the export to PDF plugin.
The code I have currently got (see below) is successfully emailing a PDF to the recipient, however it is exporting all the records in the table to PDF in the form layout.
Expand|Select|Wrap|Line Numbers
- Private Sub Command48_Click()
- On Error GoTo Err_Command48_Click
- Dim stDocName As String
- Dim stEmail As String
- Dim stSubject As String
- stDocName = "Flight Catering"
- stEmail = "my@email.com.au"
- stSubject = "XR Catering"
- DoCmd.SendObject acSendForm, stDocName, acFormatPDF, stEmail, , , stSubject, , , False
- Exit_Command48_Click:
- Exit Sub
- Err_Command48_Click:
- MsgBox Err.Description
- Resume Exit_Command48_Click
- End Sub
If anyone could please help with fine tuning this, it would be greatly appreciated.
Regards
Nita