A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Printing PDF Files in Order



 
 
Thread Tools Display Modes
  #1  
Old April 9th, 2010, 10:11 PM posted to microsoft.public.access.forms
Jonas
external usenet poster
 
Posts: 26
Default Printing PDF Files in Order

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
  #2  
Old April 9th, 2010, 10:52 PM posted to microsoft.public.access.forms
Rob Parker[_3_]
external usenet poster
 
Posts: 173
Default Printing PDF Files in Order

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

..
Jonas wrote:
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



  #3  
Old April 12th, 2010, 07:06 PM posted to microsoft.public.access.forms
Jonas
external usenet poster
 
Posts: 26
Default Printing PDF Files in Order

On Apr 9, 4:52*pm, "Rob Parker"
wrote:
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

.



Jonas wrote:
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- Hide quoted text -


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




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:18 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.