|
-
Dec 27th, 1999, 06:01 AM
#1
Thread Starter
Junior Member
i have a number of combo boxes from diferrent tables on a form that I'm using ADO to populate and Then depending on the selection by the user, I write the value to the current Table. I would like to be able to cut down the search as the person starts keying in the data. For example as a person keys in "J" cutout everything that doesn't start with "J", then if he keys in "JO" cut out everything that doesn't start with "JO" and so on. Thanks
-
Dec 27th, 1999, 07:01 AM
#2
Hyperactive Member
Try this code, I have this set up where this code is in the text1_Change event, but you may be able to play around with it a bit to get it to work with Combo boxes.
Code:
list1.ListIndex = SendMessage(listTables.hWnd, LB_FINDSTRING, -1, ByVal txtViewTable.Text)
Good luck, and let me know what you changed to get it to work with Combo boxes.
------------------
Ryan
[email protected]
ICQ# 47799046
[This message has been edited by Gimpster (edited 12-27-1999).]
-
Dec 27th, 1999, 10:28 AM
#3
Guru
Gimpster's code requires an API declaration.... add this to a module
Public Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Let us know if this is the wrong one, gimpster
Tom
-
Dec 27th, 1999, 01:45 PM
#4
Member
You can use SendMessageByString API to the window handle of the Combo Box. Assuming that you have the ComboBox's window handle.
Code:
Private Declare Function SendMessageByString Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As String) As Long
Private Const CB_FINDSTRING = &H14C
moCbo.ListIndex = SendMessageByString(moCbo.hwnd, CB_FINDSTRING, -1, txtViewTable.Text)
Ruchi
[This message has been edited by Ruchi (edited 12-28-1999).]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|