jfgambit
Kinetic Card Dealer
- Local time
- Today, 05:18
- Joined
- Jul 18, 2002
- Messages
- 798
Ok, this is driving me nuts....
Utilizing Access 2007 I have a report that I want to export as a PDF. The report is based on a query that calls for the specific ID number from a form (ID = [Forms]![frmPeerValid]![ID]). Query works fine, and if you open the report it works fine, but when I export the report via a command button on the form, all the records are exported. How do I export to PDF just the record that the individual is on? Code is as follows:
Utilizing Access 2007 I have a report that I want to export as a PDF. The report is based on a query that calls for the specific ID number from a form (ID = [Forms]![frmPeerValid]![ID]). Query works fine, and if you open the report it works fine, but when I export the report via a command button on the form, all the records are exported. How do I export to PDF just the record that the individual is on? Code is as follows:
Code:
Private Sub cmdEmail_Click()
'On Error GoTo ErrorHandle
Dim strAttachPath As String
Dim strAttachPath2 As String
'Timestamp the completed validation
If IsNull(Me.ValCompDt) Then
Me.ValCompDt = Now()
End If
'Save the record
DoCmd.RunCommand acCmdSaveRecord
'Export the report to Word RTF
strAttachPath = "C:\temp\"
strAttachPath2 = "PeerValidation" & format(Date, "yyyymmdd") & ".pdf"
If Dir(strAttachPath & strAttachPath2) <> "" Then
Kill strAttachPath & strAttachPath2
End If
DoCmd.OutputTo acOutputForm, "frmPeerValid", acFormatPDF, strAttachPath & strAttachPath2, False, , , acExportQualityScreen