VB Code:
Option Explicit
Private Declare Function SendMessageString Lib "user32" Alias "SendMessageA" _
(ByVal hWnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
ByVal lParam As String) As Long
Private Const LB_FINDSTRINGEXACT = &H1A2
Private Const CB_FINDSTRINGEXACT = &H158
Private Const CB_FINDSTRING = &H14C
Private Const LB_FINDSTRING = &H18F
Private Sub Command1_Click()
Dim lngRetVal As Long
lngRetVal = SendMessageString(Combo1.hWnd, CB_FINDSTRINGEXACT, -1&, strSomeValue)
If lngRetVal > -1& Then
' It's already in the list and lngRetVal is the ListIndex
Else
' It's not in the list
End If
End Sub
I added some extra stuff so that you can change it to do partial or exact searches on either a listbox or a combobox.