question on Report2PDF

associates

Registered User.
Local time
Today, 08:28
Joined
Jan 5, 2006
Messages
94
Hi again,

I have a form that has a listbox showing records and other buttons. One of the buttons is labelled "Convert to PDF". What it does is instead of getting a report but the report you get is in PDF format.

I've got the working codes here that does what i want it to. The problem here is that when there are more than one record showing in the listbox to be converted to PDF, i have to send the ID for each of the records via stLinkCriteria.

Here is the codes

Code:
if prmFormName = "Subject Summaries" Then
  nList = [Forms]![Subject_Summary_Selection]!LB_PrintSelection.ListCount
  Mtext = "Ready to print " + Str$(nList) + " PDF documents"
    
  For ncount = 0 To nList - 1
     stLinkCriteria = "," & [Forms]![Subject_Summary_Selection]!LB_PrintSelection.ItemData(ncount) & stLinkCriteria
  Next ncount
    
  If Len(stLinkCriteria) > 0 Then
     stLinkCriteria = "[S_ID] In (" & Mid(stLinkCriteria, 2) & ")"
  End If
End If

DoCmd.OpenReport prmRptName, , , stLinkCriteria 'Run the report

This works when there is only one record found in the listbox. By works i mean you get the PDF report. It kinda stops in the process of converting report to PDF if there are more than one record in the stLinkCriteria.

In the report, the record source is a query, not a single table. is it because of the query that makes the process of ReportToPDF conversion hang? because with only one table, the conversion works very smoothly even for more than one records in the stLinkCriteria.

Thank you in advance
 

Users who are viewing this thread

Back
Top Bottom