new ReportToPDF

J

johnlute

I'm having real trouble with the following:

blRet = ConvertReportToPDF("rptComplaints", vbNullString, _
"rptComplaints", Value & ".pdf", False, True, 150, "", "", 0, 0, 0)

The debugger highlights "ConvertReportToPDF" and states Compile error:
wrong number of arguments or invalid property assignment.

I've tinkered every which way and it only gets worse. Anyone have an
idea?

Thanks!!!
 
G

Gina Whipp

johnlute,

The ConvertoToPDF has 10 arguments and you have 12. Looks like your report
name needs some fixing???


Public Function ConvertReportToPDF( _
Optional RptName As String = "", _
Optional SnapshotName As String = "", _
Optional OutputPDFname As String = "", _
Optional ShowSaveFileDialog As Boolean = False, _
Optional StartPDFViewer As Boolean = True, _
Optional CompressionLevel As Long = 0, _
Optional PasswordOwner As String = "", _
Optional PasswordOpen As String = "", _
Optional PasswordRestrictions As Long = 0, _
Optional PDFNoFontEmbedding As Long = 0 _
) As Boolean

--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
D

Dirk Goldgar

johnlute said:
I'm having real trouble with the following:

blRet = ConvertReportToPDF("rptComplaints", vbNullString, _
"rptComplaints", Value & ".pdf", False, True, 150, "", "", 0, 0, 0)

The debugger highlights "ConvertReportToPDF" and states Compile error:
wrong number of arguments or invalid property assignment.

I've tinkered every which way and it only gets worse. Anyone have an
idea?


It looks to me like you've got an extra argument "rptComplaints" in there.
Have you tried ...

blRet = ConvertReportToPDF("rptComplaints", vbNullString, _
Value & ".pdf", False, True, 150, "", "", 0, 0, 0)

?

I'm not happy with the idea that you have a variable, field, or object named
"Value", either, since that's a common property of objects and should be
considered a reserved word.
 
D

Dirk Goldgar

Gina Whipp said:
johnlute,

The ConvertoToPDF has 10 arguments and you have 12.

I make it 11 that John has. But what's an extra argument or two among
friends?
 
G

Gina Whipp

ConvertReportToPDF("rptComplaints", - 1
vbNullString, - 2
"rptComplaints", - 3
Value & ".pdf", - 4
False, - 5
True, - 6
150, - 7
"", - 8
"", - 9
0, - 10
0, - 11
0 - 12)

That's why I thought the report name was the problem. Hmmm, does that mean
there is an argument between us??? ;-)


--
Gina Whipp

"I feel I have been denied critical, need to know, information!" - Tremors
II

http://www.regina-whipp.com/index_files/TipList.htm
 
D

Dirk Goldgar

Gina Whipp said:
ConvertReportToPDF("rptComplaints", - 1
vbNullString, - 2
"rptComplaints", - 3
Value & ".pdf", - 4
False, - 5
True, - 6
150, - 7
"", - 8
"", - 9
0, - 10
0, - 11
0 - 12)

That's why I thought the report name was the problem. Hmmm, does that
mean there is an argument between us??? ;-)

Heaven forfend!

You're right, I counted wrong. But you are also referring to an older
version of Stephen Lebans' utility. I have this declaration:

Public Function ConvertReportToPDF( _
Optional RptName As String = "", _
Optional SnapshotName As String = "", _
Optional OutputPDFname As String = "", _
Optional ShowSaveFileDialog As Boolean = False, _
Optional StartPDFViewer As Boolean = True, _
Optional CompressionLevel As Long = 0, _
Optional PasswordOpen As String = "", _
Optional PasswordOwner As String = "", _
Optional PasswordRestrictions As Long = 0, _
Optional PDFNoFontEmbedding As Long = 0, _
Optional PDFUnicodeFlags As Long = 0 _
) As Boolean

This version has 11 arguments, not 10.
 
S

Steve Sanford

I'm not happy with the idea that you have a variable, field, or object named
"Value", either, since that's a common property of objects and should be
considered a reserved word.

I don't think the OP has an object named "Value". Looking at the example
from Stephen's (great name, BTW <g>), the report name is from a list box,
with the PDF name being created from the list box plus ".PDF". The OP changed
the list box ref to a hard coded name, but didn't delete the "Value" and
combine the filename and extension.


' this is from the example mdb "A2000SnapshotToPDFver785.mdb":

blRet = ConvertReportToPDF(Me.lstRptName, vbNullString, _
Me.lstRptName.Value & ".pdf", False, True, 150, "", "", 0, 0, 0)

Me.lstRptName is the listbox name on the form.

:D
 
J

johnlute

I don't think the OP has an object named "Value". Looking at the example
from Stephen's (great name, BTW <g>), the report name is from a list box,
with the PDF name being created from the list box plus ".PDF". The OP changed
the list box ref to a hard coded name, but didn't delete the "Value" and
combine the filename and extension.

' this is from the example mdb "A2000SnapshotToPDFver785.mdb":

blRet = ConvertReportToPDF(Me.lstRptName, vbNullString, _
Me.lstRptName.Value & ".pdf", False, True, 150, "", "", 0, 0, 0)

Me.lstRptName is the listbox name on the form.

:D
--
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)







- Show quoted text -

This has been a fun read! I tried to reply to your response to my
other thread but it kept giving an error. That thread must be haunted
because my intentions were to start a new thread however my posts
somehow ended up inserting into that thread! Sorry for the confusion.

Anyway, your suggestion did the trick.! Actually, I had to throw in
the "_" at the end of the first line:
blRet = ConvertReportToPDF("rptComplaints", vbNullString, _
"rptComplaints.pdf", False, True, 150)

I *wish* I was a real programmer so I could understand this better.
Oh, well...Irving Berlin couldn't read or write music and I believe he
could only play in one key (F#...?) but that didn't stop him from
playing the piano!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

ReportToPDF 1
ReportToPDF 15
ReportToPDF with DataRange 2
Converting multiple reports to PDF 0
using unbound comboboxes 1
ReportToPDF with Filter 3
ConvertReportToPDF from Stephen Lebans 3
Code not cycling!! 4

Top