Open report from multivalue fields

Here is sample code I have been trying to work with:
Code:
Private Sub cmdOpenReportSelected_Click()
    Dim frm As Form, ctl As Control
    Dim varItm As Variant, intI As Integer
    On Error GoTo Err_cmdOK_Click
 
    Set frm = Forms!openReport
    Set ctl = frm!cboType
    For Each varItm In ctl.ItemsSelected
        For intI = 0 To ctl.ColumnCount - 1
    DoCmd.OpenReport "Report", acViewPreview, , "[Kind] = ctl.ItemData(varItm)"
 
    Next intI
 
    Next varItm
 
    DoCmd.Close acForm, "openReport", acSaveNo
 
Err_cmdOK_Click:
If Err.Number = 2501 Or Err.Number = 2046 Then
Resume Next
End If
End Sub
[Kind] is a multivalue field in the table/report. The report does not open.
 
Last edited:
Back
Top