Greetings,
This is my first post so I will try to be brief and accurate.
I have a report that uses 9 user selectable filters (Dates, Y/N's as Combo Boxes and 4 Multi-Select List Boxes. 2 of the Multi-Select Boxes acquire their data from other tables as Lookup's. All functions for the filters operate properly pulling the data needed. One of my options with the data is to send it to a Report that can be printed.
The request now comes to add the filters used to a cover page. That is all accomplished, EXCEPT for the Lookup's. The Bound ID number used is sent to the report instead of the Displayed selection. How can I get that Lookup to display on the report? Alternately, is their an easier way to do what I want that I overlooked?
Sample Code is below. In this code, modified from Allen Browne's Multi-Select List Box filter code, I create an Array that stores each selection from the Multi-Select List Box and sends it to a hidden text field. That field is shown on the cover page of the report. It's messy but works.
This is my first post so I will try to be brief and accurate.
I have a report that uses 9 user selectable filters (Dates, Y/N's as Combo Boxes and 4 Multi-Select List Boxes. 2 of the Multi-Select Boxes acquire their data from other tables as Lookup's. All functions for the filters operate properly pulling the data needed. One of my options with the data is to send it to a Report that can be printed.
The request now comes to add the filters used to a cover page. That is all accomplished, EXCEPT for the Lookup's. The Bound ID number used is sent to the report instead of the Displayed selection. How can I get that Lookup to display on the report? Alternately, is their an easier way to do what I want that I overlooked?
Sample Code is below. In this code, modified from Allen Browne's Multi-Select List Box filter code, I create an Array that stores each selection from the Multi-Select List Box and sends it to a hidden text field. That field is shown on the cover page of the report. It's messy but works.
Code:
...
Dim strWhere As String
Dim lngLen As Long
Dim Criteria2 As String
Dim Criteria2Array() As String ' Array - Used to pass info to a Text Field.
Dim Criteria2dual As String ' Gathers looped data.
For Each j In Me![List2].ItemsSelected
ReDim Criteria2Array(p To 150) As String
If Criteria2 <> "" Then
Criteria2dual = Criteria2dual
Criteria2 = Criteria2 & " OR "
End If
Criteria2Array(p) = Criteria2dual & Me![List2].ItemData(j)
Criteria2dual = Criteria2dual & Me![List2].ItemData(j) & ", "
Criteria2 = Criteria2 & "[CSS_CSM_Names]='" & Me![List2].ItemData(j) & "'"
Next j
If Criteria2 > "" Then
Criteria2 = "(" & Criteria2 & ")"
strWhere = strWhere & Criteria2 & " AND "
MsgBox Criteria2Array(p)
If Criteria2Array(p) <> "" Then
Me.List2Storage.Value = Criteria2Array(p)
Else
Me.List2Storage.Value = "All Selected"
End If
lngLen = Len(strWhere) - 5
If lngLen <= 0 Then
MsgBox "You Have Selected All Files!", vbInformation, "Everything Selected"
Else
strWhere = Left$(strWhere, lngLen)
Me.Filter = strWhere
Me.FilterOn = True
End If
Comment