I have a form, with a list box. The user selcts various items from the list. I want to print a report based on the users selections. So far I have this:
So, txtSeeValue now contains a list (example: 12,13,14) that I'd like to place into my criteria, something like: In ([Forms]![frmByChris_PrintMultSchedules]![txtSeeValue]) for the query that the report uses. This does not work as the expression [Forms]![frmByChris_PrintMultSchedules]![txtSeeValue] returns a string value so basically In() reads like this when it is processed In("12,13,14"); therefore, searching for that string and not the various elements.
One idea I have is to create a function that returns what I need, but I am worried that any list type thatis returned will be evaluated by In() as a single element.
-Chris
Starlight B. M.
Code:
Private Sub OpenSchedule_Click()
On Error GoTo Err_OpenSchedule_Click
txtSeeValue.Value = ""
Dim intCurrentRow As Integer
For intCurrentRow = 0 To ListSelect.ListCount - 1
If ListSelect.Selected(intCurrentRow) Then
txtSeeValue.Value = txtSeeValue.Value & ListSelect.Column(0, intCurrentRow) & ","
End If
Next intCurrentRow
txtSeeValue.Value = Left(txtSeeValue.Value, Len(txtSeeValue.Value) - 1)
Exit_OpenSchedule_Click:
Exit Sub
Err_OpenSchedule_Click:
MsgBox Err.Description
Resume Exit_OpenSchedule_Click
End Sub
One idea I have is to create a function that returns what I need, but I am worried that any list type thatis returned will be evaluated by In() as a single element.
-Chris
Starlight B. M.