A
Anne
Is it possbile to use a List box to select several item to display in the
form.
I am trying to select greenhouses benches, but I would like to be able to
select several benches at a time. I have some double or split benches.
I have created the unbound list box and after selecting the benches I would
like the form to only display the items selected in the list box.
I created a command button:
Private Sub Command62_Click()
Dim varSelected As Variant
'Dim strWhere As String
Dim strSQL As String
For Each varSelected In Me!lstSelect.ItemsSelected
strSQL = strSQL & Me!lstSelect.ItemData(varSelected) & ","
Next varSelected
If strSQL <> "" Then
strSQL = "[GHBenchID] IN (" & Left(strSQL, Len(strSQL) - 1) & ")"
End If
End Sub
This code is actually part of a multi select list box I have been using to
open a report.
As far as the form goes, it does nothing, and I can see where some code is
missing, which whould actually restrict the data on my form.
Anne
form.
I am trying to select greenhouses benches, but I would like to be able to
select several benches at a time. I have some double or split benches.
I have created the unbound list box and after selecting the benches I would
like the form to only display the items selected in the list box.
I created a command button:
Private Sub Command62_Click()
Dim varSelected As Variant
'Dim strWhere As String
Dim strSQL As String
For Each varSelected In Me!lstSelect.ItemsSelected
strSQL = strSQL & Me!lstSelect.ItemData(varSelected) & ","
Next varSelected
If strSQL <> "" Then
strSQL = "[GHBenchID] IN (" & Left(strSQL, Len(strSQL) - 1) & ")"
End If
End Sub
This code is actually part of a multi select list box I have been using to
open a report.
As far as the form goes, it does nothing, and I can see where some code is
missing, which whould actually restrict the data on my form.
Anne