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
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