Print report in pdf format

Paul200968

Registered User.
Local time
Today, 15:26
Joined
Apr 3, 2006
Messages
14
Hi,

Would it be possible to print a report from access in PDF format to location "c:\temp\" I know this can be done manually by selecting printer "Adobe PDF" but could someone help me todo this via VBA.

Idea is that I have this form and when I press the Print button, the report is generated in PDF.

Best regards,

Paul
From Holland.
 
I set a form timer for 500 milliseconds before calling print. This way my Form_Timer function can use SendKeys() to enter directory and file name information without the user having to interact. Not eloquent but it works.

Private Sub Whatever()
Application.Printer = Application.Printers("Adobe PDF")
DoCmd.OpenReport rptName, acViewPreview
Me.TimerInterval = 500
DoCmd.PrintOut
End Sub

Private Sub Form_Timer()
SendKeys remotepath & filename & "{ENTER}"
TimerInterval = 0
End Sub
 
I set a form timer for 500 milliseconds before calling print. This way my Form_Timer function can use SendKeys() to enter directory and file name information without the user having to interact. Not eloquent but it works.

Private Sub Whatever()
Application.Printer = Application.Printers("Adobe PDF")
DoCmd.OpenReport rptName, acViewPreview
Me.TimerInterval = 500
DoCmd.PrintOut
End Sub

Private Sub Form_Timer()
SendKeys remotepath & filename & "{ENTER}"
TimerInterval = 0
End Sub


Hi,

I have put the sub whatever under a button of the form which works but where do I put the Private Sub Form time? I get this dialogue box to save this file but no sendkey is sent..
Can you show me in the example location c:\test.pdf in de sendkey part. Im a new with this so any help would be very appriciated

Rgrds,

Paul.
 

Users who are viewing this thread

Back
Top Bottom