Printing PDF Files in Order

J

Jonas

I have a table with links on it to PDF files. I would like to print
the files in the order that they appear in the table. When I run the
code to print out the files, they seem to come out of the printer in a
random order. Below is a snipet of my code. Does anybody have any
suggestions?

Do Until myRecordset.EOF
tempname = myRecordset.Fields(1).Value
If tempname <> "" Then

tempname2 = Replace(tempname, "#", "")

If fso.FileExists(tempname2) Then
ADOBEPATH = "C:\Program Files\Adobe\Reader 8.0\Reader\AcroRd32.exe"
PDFFILE = tempname2
Shell """" & ADOBEPATH & """/p /h """ & PDFFILE & """"

End If

End If

myRecordset.MoveNext
Loop
 
R

Rob Parker

If your recordset is based on the table, there will be no defined order to
it (it will probably be sorted by the primary key field, and the records
should appear in the same order each time). If you need it sorted by a
specific field, build a query which does so, and open the recordset based on
that query.

HTH,

Rob

..
 
J

Jonas

If your recordset is based on the table, there will be no defined order to
it (it will probably be sorted by the primary key field, and the records
should appear in the same order each time).  If you need it sorted by a
specific field, build a query which does so, and open the recordset basedon
that query.

HTH,

Rob

.










- Show quoted text -

Everything was in order. I created a do until loop to delay the
processing eight seconds which seems to be enough time for the PDF
file to be sent to the printer. It works now.
 

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

Slow down Module 1
PDF export buggy? 2
How to open a pdf file 14
PDF files 9
printing invoices to pdf files 1
R/T error 53 - File Not Found 4
Print batch to pdf 1
Printing Extra Pages to PDF 1

Top