By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,587 Members | 1,076 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,587 IT Pros & Developers. It's quick & easy.

Combo Box was ok, but replaced it with Incremental Search that doesn't quite work

P: n/a
I have an app that looks up an id number and when a button is clicked,
inputs the id # into a query. After running the query, I click a second
button which grabs the client name rather than the id for input to another
operation.
Originally, I had a drop-down box with the client name and the client id
number and it worked fine, but it was for a demo and was quick-and-dirty.
For the real app, there are over 1,700 client ids and the drop-down was
impractical.

I copied the incremental search textbox approach from the cd that came with
Getz's book. It works for the first part. But when I click the second
button, it retains the client id and does not grab the client name. Now I
am getting the id from the textbos (where the client types in search info),
but am trying to get the client name from the listbox (the box that shows
all of the clients). If I manually click on an entry in the listbox, the
value that is passed to the sub is the client name, which is what I want.
If the textbox value selects the listbox value, then the value passed to the
sub is the value of the client id and not the client name.

The above may sound somewhat convoluted and I hesitate to make things
murkier, but hopefully this will clarify it. When the user types in a value
to search in the textbox, a value in the listbox is highlighted. But when I
manually click in the listbox, it is not only highlighted, there is a little
rectangle around the highlighted item. I assume that means that the control
has focus. When that occurs, the correct value is passed. But when it is
highlighted without the selection rectangle around it, the wrong value is
passed.

I tried using lstIncSrch.SetFocus followed by lstIncSrch.BoundColumn = 1,
but this did not work even though it appeared to me to be an issue of which
control had focus.

Sorry if that is long-winded and muddled, but hopefully somebody's got an
answer for me as to how I can fix this. With the combo box it was simply a
matter to change the BoundColumn property at the beginning of the sub and
change it back at the end.

Thanks for your help.
Alan


Nov 12 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.