Open report from multivalue fields

Joined
Mar 25, 2009
Messages
13
Reaction score
0
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:

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top