Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ms access report printing

Status
Not open for further replies.

abenitez77

IS-IT--Management
Oct 18, 2007
147
US
I have some code that i use to print a report and after the report it goes out to print a tif image with a 3rd part exe. The tif image is being printed across the internet so it could take a few seconds or 2 or 3 minutes...depending on the size of the image. The report has multiple records and it prints 1 record then the tif image(s) then loops back and goes to record 2 and the tif images that goes with it. How do i get it to pause and wait till it is finished printing that tif image before it goes and prints the next record of the ms report?

My code:
Private Sub Print_Click()

Dim rst As Recordset
Dim db As Database
Dim temp As String
Dim svrname As String

Set db = CurrentDb
Set rst = db.OpenRecordset("imagepaths", dbOpenDynaset)

svrname = fOSMachineName

If rst.EOF = True And rst.BOF = True Then
Exit Sub
Else
rst.MoveLast
rst.MoveFirst
temp = "0"

Do Until rst.EOF = True

If temp <> rst![CLAIMNO] Then
DoCmd.OpenReport "Claim_Assembler1", acViewNormal, , "[CLAIMNO2]=" & rst![CLAIMNO2]
Delay 5
End If



If Right(LTrim(RTrim(rst![IMAGEPATH])), 3) = "TIF" Or Right(LTrim(RTrim(rst![IMAGEPATH])), 3) = "JPG" Then
'usbPrintFile rst![ImagePath]
ShellandWait ("\\" & svrname & "\Imdex\ImdexPrintFitPageLandscape.exe " & rst![IMAGEPATH])
'Delay 3
End If

temp = rst![CLAIMNO]

rst.MoveNext

Loop

End If
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top