I'm way out of my depth here, this is code from Google that claims to search an Access Listbox for a particular string and return the list index.
It doesn't work because Me.ListBox1.hWnd is method or data member not found.
But would it work that that is known or found? And if yes, can the function be told to look in a particular column?
Thanks.
Code:
Private Declare Function SendMessage Lib "User32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Integer, ByVal wParam As Integer, lParam As Any) As Long
Function ListboxFindString(strSearchString As String, lHwndListbox As Long) As Long
Const LB_FINDSTRING = &H18F
ListboxFindString = SendMessage(lHwndListbox, LB_FINDSTRING, -1, ByVal strSearchString)
End Function
Sub dodo()
Debug.Print ListboxFindString("4", Me.ListBox1.hWnd)
End Sub
But would it work that that is known or found? And if yes, can the function be told to look in a particular column?
Thanks.