Hi everyone,

I am not a programmer at all and I am trying to figure out how to get a WhereCondition to print a second page of a report if a flag called "MULTI_PAGE" is set which is available in the 1st reports table. The 1st report, or 1st page, prints fine with the code below.

My question is: Is it possible to look at that "MULTI_PAGE" flag in the existing VB print routine below and have it print the form (page 2+) only when the "MULTI_PAGE" flag is set? The page 2 form is called "BL 2".

So, for example, there may be 5 BOLs with only 1 page so those 5 will print, then the 6th might be a 2 page BOL, so both pages will print in sequence, etc.

They originally select the BOL groups to print from a listbox.

Private Sub cmdPrintBOLs_Click()
Dim sWhere As String, vItem As Variant
With lstSelectTrailers
For Each vItem In .ItemsSelected
If Len(sWhere) <> 0 Then sWhere = sWhere & " OR "
sWhere = sWhere & "(CARRIER_NA='" & .Column(1, vItem) _
& "' and TRAILER_NU='" & .Column(2, vItem) & "')"
Next vItem
End With
If Len(sWhere) = 0 Then
MsgBox "You have not selected any trailer(s)"
' Debug.Print sWhere
DoCmd.OpenReport "Bill OF Lading", , WhereCondition:=sWhere
End If
If MsgBox("Do you wish to mark all these BOLs an 'Printed'?", vbQuestion Or vbYesNo) = vbYes Then
CurrentDb.Execute "Update bl_File set Printed = True where " & sWhere
End If
End Sub