Report to PDF

jsv2002

Registered User.
Local time
Today, 23:23
Joined
Feb 11, 2009
Messages
240
Hi all,

I am using the excellent Peter Leban's Report to PDF and have got it working almost how I want.

I have seen another thread http://www.access-programmers.co.uk/forums/showthread.php?t=170274&highlight=vbNullString which partially answers my question but heres what I want to do:

I have got the file name from a control on my form name RptName (Just to keep things simple) which is a concated value of a prefix with the autonumber of the table (which works surprising well for this purpose)

This is in the onclick event procedure:

Dim blRet As Boolean
Dim stDocName As String

stDocName = "rptCopyInvoiceD1"
' Call our convert function
' Please note the last param signals whether to perform
' font embedding or not. I have turned font embedding ON for this example.
blRet = ConvertReportToPDF(stDocName, vbNullString, _
Me.RptName.Value & ".pdf", False, True, 150, "", "", 0, 0, 0)

Now I also have a control on the form which contains the name of the path I would like the generated PDF saved to (several different locations saved in a table which the user can select as default paths for different types of documents e.g. Reports, Invoices etc..)

The bit I cant get my head round is appending the value of the form control which might be something like "C:\Company\Reports" and keep the above to give the produced PDF its filename?

All sounds very confusing basically I want the value of the file path and file name to be passed to the module from the form.

Many thanks in advance for any help :)

Cheers John
 
Something like this?

Me.ControlName & "\" & Me.RptName.Value & ".pdf"
 
Thanks for the suggestion will try and many thanks also for your original post :)
 
Well tried it and worked like a charm many thanks Paul for your advise spent almost 2 days scratching around trying to make it work (like to try and do it myself first.... pride comes before the fall and all that lol..)

Was almost there just the syntax which you had right away gotta say love this forum and the help it gives :)

Again many thanks stopped me "screaming at the screen" till the next one anyway!

Cheers John
 
No problem, John. And don't scream at the screen, just throw it out the window! :p
 
Yeah tried that but my wife complains about the drafts when it breaks them.. anyways thanks very much your a saviour of "windows" the ones in my house anyways the OS well we all live with ;)
 

Users who are viewing this thread

Back
Top Bottom