danfoster
asked on
DBCombo - Won't search...
I've used the DBCombo control on several apps in VB5/ISGDataControl(ADO). Works fine, displays the ListField items in dropdown - but have never been able to get it to search the ListField for the users input. VB5 help sez: "Users can search the DBCombo control by typing a value into the text box portion of the control. Once entered, this value is located in the list and the current list item is set to that item." This isn't happening, regardless of how I set any/every property that appears even remotely related to the seach behavior that I assume exists. Any help would be greatly appreciated.
Dan Foster
Dan Foster
the style of the combo box is change at the Properties windows...
ASKER
Thanks, but I've tried the dbcDropDownList Style setting - and just about every other property/method that I can find, without success. I am using the DBCombo control that came with the Enterprise version of VB5 with SPk3 installed. I'll try an eval of 3rd party list controls, but still I wonder if it is a known limitation of the standard control when using ADO (ISGData control)or something else...
I've experienced the same non-behavior... I think the control just doesn't work as advertised. You MAY be able to code the darn thing to search and select in the keypress event of the control. (just thought of this... may do is myself) But as for the "factory" control, I don't think it will do it.
try this:
style of the DBCombo to 2 - dbcDropdownList and then set the
MatchEntry property to 1 - Extended Matching.
vmano
style of the DBCombo to 2 - dbcDropdownList and then set the
MatchEntry property to 1 - Extended Matching.
vmano
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Craig, Thanks for the code. I gave it a shot in a testApp. Encountered problem because the SendMessage function from your code appears to be undefined. My testApp chokes on:
nIndex = SendMessage(pComboListBox. hwnd, CB_FINDSTRING, -1, _
cSearch)
I can't finded any embedded functions by this name. What does SendMessage reference. Thanks, Dan
nIndex = SendMessage(pComboListBox.
cSearch)
I can't finded any embedded functions by this name. What does SendMessage reference. Thanks, Dan
Sorry mate i forgot to put that in
it is a call to the windows api
'Put this in the global declarations of the form
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 me know what happens)
Cheers
Craig
it is a call to the windows api
'Put this in the global declarations of the form
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 me know what happens)
Cheers
Craig
ASKER
Thanks Craig, I got it to work. Learned a bit about making API calls which is new territory for me.
Dan
Dan
2 - dbcDropdownList...although