Still getting hung; this is what I have - getting no action when clicking
on
"Asian" in my list box.
In a module, I pasted your code
Public Function SetSelections(List As Access.ListBox, _
Column As Long, ParamArray Items())
Dim i&, p&
For i = LBound(Items) To UBound(Items)
p = ListIdx(List, Items(i), Column)
If p > 0 Then List.Selected(p) = True
Next
End Function
Public Function ListIdx(List As Access.ListBox, Find As Variant, _
Optional Column As Long = 0) As Long
Dim t$, i&
t = Replace(Find, "'", "")
t = Replace(t, Chr(34), "")
ListIdx = -1
For i = 0 To List.ListCount - 1
If List.Column(Column, i) = t Then
ListIdx = i
Exit For
End If
Next
End Function
In the form, On Click Event Property, I have
Private Sub lstType_Click()
On Error GoTo lstType_Click_Err
'Select corresponding rows in List Box
If Forms!frmSelectCriteria!lstType.Value = "Asian" Then
SetSelections Forms!frmSelectCriteria!lstType, 0, _
"Asian/Domestic", "Asian/European", "Asian/Domestic/European"
End If
If Forms!frmSelectCriteria!lstType.Value = "European" Then
SetSelections Forms!frmSelectCriteria!lstType, 0, _
"European/Domestic", "Asian/European", "Asian/Domestic/European"
End If
If Forms!frmSelectCriteria!lstType.Value = "Domestic" Then
SetSelections Forms!frmSelectCriteria!lstType, 0, _
"European/Domestic", "Asian/Domestic", "Asian/Domestic/European"
End If
lstType_Click_Exit:
Exit Sub
lstType_Click_Err:
MsgBox Err.Description
Resume lstType_Click_Exit
End Sub
Any more ideas where error might be or why no action taking place?
Thanks,
Stuart Wentzel