Hey all,
Still battling with this multi-select listbox problem.
I found the following code:
On Error GoTo Err_Print_ClickErr
Dim vntIndex As Variant
Dim strValue As String
If ListBoxName.ListIndex < 0 Then
MsgBox "Please select 1 or more items from the list"
Exit Sub
End If
For Each vntIndex In ListBoxName.ItemsSelected
strValue = ListBoxName.ItemData(vntIndex)
DoCmd.OpenReport strValue, acViewNormal
Next
Err_Print_ClickErr:
Select Case Err.number
Case 2501 'cancelled by user or no data for the report
MsgBox "Report cancelled or no data found for the report.", vbInformation, "Information"
' Case Else
' MsgBox "Error " & Err & ": " & Error$, vbInformation, "Print_Click()"
End Select
I think I get it all. But where does it specify the name of the report to print?
Cheers.
Still battling with this multi-select listbox problem.
I found the following code:
On Error GoTo Err_Print_ClickErr
Dim vntIndex As Variant
Dim strValue As String
If ListBoxName.ListIndex < 0 Then
MsgBox "Please select 1 or more items from the list"
Exit Sub
End If
For Each vntIndex In ListBoxName.ItemsSelected
strValue = ListBoxName.ItemData(vntIndex)
DoCmd.OpenReport strValue, acViewNormal
Next
Err_Print_ClickErr:
Select Case Err.number
Case 2501 'cancelled by user or no data for the report
MsgBox "Report cancelled or no data found for the report.", vbInformation, "Information"
' Case Else
' MsgBox "Error " & Err & ": " & Error$, vbInformation, "Print_Click()"
End Select
I think I get it all. But where does it specify the name of the report to print?
Cheers.