bwestly
asked on
Query returns more than one hyperlink report to print. How can I print all the ones it finds?
I have one or more pdf documents linked to a form, but my code will only print one of the documents, not all. What do I need in order to print all the documents the query finds on this command button?
Private Sub prtndt_Click()
On Error GoTo Err_prtndt_Click
Dim qd As Long
qd = DCount("*", "qryLinkedDocuments", "det_id=" & Me!ID)
If qd > 0 Then
strfile = DLookup("ImagePath", "qrylinkeddocuments", "det_id=" & Me!ID)
ShellExecute Me.hwnd, "open", strfile, Chr$(0), strPath, 3
Else
MsgBox "There are no NDTs to print.", vbOKOnly
End If
Exit_prtndt_Click:
Exit Sub
Err_prtndt_Click:
MsgBox Err.Description
Resume Exit_prtndt_Click
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
set rs = currentdb.openrecordset('s elect * from qrylinkeddocuments where det_id= " & Me!ID)
set rs = currentdb.openrecordset("s elect * from qrylinkeddocuments where det_id= " & Me!ID)
ASKER
Sorry, Surone1
I didn't get any emails about your answer. Don't know where they went. I will check this out tomorrow and let you know if it works.
Thanks.
I didn't get any emails about your answer. Don't know where they went. I will check this out tomorrow and let you know if it works.
Thanks.
ASKER
Thank you for the great information. I'm so sorry it took so long to get back into the problem. I can print multiple PDFs with no problem now.