Unanswered: Problem with List Box - Microsoft Access (2003)
Microsoft Access - version 2003
Hi everyone, I have a list box with the following code directly associated with a button. When I run the report, the results are fine. My problem is that when I press the button to run the report, I get a parameter window for the dates, which is okay, but then I get more parameter windows for each employee I selected in the drop-down list. Can someone help me eliminate the employee parameter windows for each employee selected upon runtime???
THANK YOU VERY MUCH
Private Sub BTN_EMPLOYEE_Click()
Dim strEmployee As String
Dim varItem As Variant
'make sure a selection has been made
If Me.LIST_EMPLOYEE.ItemsSelected.Count = 0 Then
MsgBox "Must select at least 1 employee"
'add selected values to string
For Each varItem In Me.LIST_EMPLOYEE.ItemsSelected
strEmployee = strEmployee & Me.LIST_EMPLOYEE.ItemData(varItem) & ","
'Use this line if your value is text
strEmployee = strEmployee & "'" & Me.LIST_EMPLOYEE.ItemData(varItem) & "',"