HI all,
I cannot figure out how to concat this and have tried so many ways?
I marked it in red below
Code:
Private Sub CmdReport_Click()
On Error Resume Next
Dim varItem As Variant
Dim strDoc As String
If IsNull(Me.LstAccountReport.Column(0)) Then
MsgBox "You must select a Report from Reprot List!"
Exit Sub
End If
With Me.LstAccountReport
For Each varItem In .ItemsSelected
strDoc = .Column(1, varItem) 'assumes list box has two columns, the first one holding the reportID is the bound one and hidden
Next
End With
If Not IsNull(Me.LstAccountType.Column(0)) And (Me.grpFilterOptions = 2) Then
DoCmd.OpenReport strDoc, acViewPreview, , "[AccountTypeID] in(" & getLBX(Me.LstAccountType) & ")"
ElseIf Not IsNull(Me.LstAccountType.Column(0)) And (Me.grpFilterOptions = 1) Then
DoCmd.OpenReport strDoc, acViewPreview, , "[AccountTypeID] in(" & getLBX(Me.LstAccountType) & ") AND" & Forms![frmAccount].[sfrmAccount].Form.txtReportFilter, , "frmAccountReport"
ElseIf Forms!frmAccount.sfrmAccount.Form.chkSingle = True Then
If Me.grpFilterOptions = 2 Then
DoCmd.OpenReport strDoc, acViewPreview, , "AccountID=" & Forms!frmAccount!AccountID, , "frmAccountReport"
Else
DoCmd.OpenReport strDoc, acViewPreview, , "AccountID=" & Forms!frmAccount!AccountID & Forms![frmAccount].[sfrmAccount].Form.txtReportFilter, , "frmAccountReport"
End If
Else
If Me.grpFilterOptions = 2 Then
DoCmd.OpenReport strDoc, acViewPreview
Else
DoCmd.OpenReport strDoc, acViewPreview, , Forms![frmAccount].[sfrmAccount].Form.txtReportFilter, acNormal, "frmAccountReport"
End If
End If
Thank you
Dave