export report PDF

tubar

Registered User.
Local time
Today, 16:56
Joined
Jul 13, 2006
Messages
190
so i have a code to export a print preview of a report...i want to cahenge the code to export the specific report...the code is

Private Sub AddDeleteEmployees_Click()
On Error GoTo Err_AddDeleteEmployees_Click

Screen.PreviousControl.SetFocus
DoCmd.OpenReport "invoice", acPreview, , "[event.id] = " & Me.[Combo2] & " And [client.id] = " & Me.[Combo0] & " And [venue.id] = " & Me.[Combo4]

Exit_AddDeleteEmployees_Click:
Exit Sub

Err_AddDeleteEmployees_Click:
MsgBox Err.Description
Resume Exit_AddDeleteEmployees_Click

End Sub
 
If you are using Access '07 or latter you can use the DoCmd.OutPutTo method to save your Report as PDF format.

If you are using an earlier version you will need to have a look at Lebans solution
 
THANKS GUYS!!! excellent info...for all others this is what i did

Private Sub Command98_Click()
On Error GoTo Err_Command98_Click

Screen.PreviousControl.SetFocus
DoCmd.OpenReport "invoice", acPreview, , "[event.id] = " & Me.[Combo2] & " And [client.id] = " & Me.[Combo0] & " And [venue.id] = " & Me.[Combo4]
DoCmd.OutputTo acOutputReport, "", acFormatPDF
DoCmd.Close acReport, "invoice"

Exit_Command98_Click:
Exit Sub

Err_Command98_Click:
MsgBox Err.Description
Resume Exit_Command98_Click


End Sub
 

Users who are viewing this thread

Back
Top Bottom