Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Combobox for large volume of records 1

Status
Not open for further replies.

suec032a

Programmer
Jun 22, 2009
20
AU
Hi,
On page 2 of my pageframe, I have 3 comboboxes as follows:

colour (452 choices in list)
breed (1030 choices in list)
Vet (532 choices in list) with 2nd colum containing vet phone number which I need to display as well

the lookup tables for these values are indexed.

I need the users to perform an incremental search for these comboxboxes, then select their choice using either the mouse or Enter key.

I am a bit lost with the Supercombo code in FAQ, especially with having the commandbutton and I beleive Tamar had a solution similar to the quickfill cbo but can't seem to locate this.

Any help on this would be fantastic.

Sue

 
Sue,

You don't need anything special to do an incremental search. You just set the combo's IncrementalSearch property to .T.

This will allow the user to start typing a character sring; as they hit each key, the highlight will move to the first entry that matches what they have typed so far.

However, you mentioned Tamar's Quickfill class. If I remember right, this isn't an incremental search combo, but rather an auto-complete textbox, modelled on the ones found in Quicken and the like. If that's what you want, you can use an ordinary textbox with its AutoComplete property set to 1.

Personally, I think that would be a better solution than using a combo, given the number of entries you are using. In general, a combo box works best with fewer than a few dozen entries. Once you get into the hundreds and thousands of entries, the interface gets somewhat clumsy.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Sue

There is a mechanism that allows you to contact the author of a FAQ such as the one you mentioned, to be found at the bottom of the FAQ page.
Send a comment ...
Doing so will alert the author that a FAQ is under discussion, and he/she may be willing to contribute to the thread and provide you with more options.

FAQ184-2483​
Chris [pc2]
PDFcommander.com
motrac.co.uk
 
Thanks Mike. I haven't used the auto-complete so will look into this and give it a go.

I was under the impression from some of the articles that I have been reading, that a special combo/grid combination was the way to go with large volumes, but the auto-complete sounds good. Mind you most of the articles have been a few years old.

Thanks Chris for the information concerning the FAQ's.

Sue
 
Sue,

Different developers have different ideas about how to do this, so don't take my word for it. But where there are thousands of entries to choose from, I'd favour a search form of some kind. Alternatively, you could consider displaying a grid (in alphabetical order) and letting the user double-click on a row to select it.

On the other hand, where the user can enter new values as well as look up existing ones, I'd go for the auto-complete text box. This is useful if, for example, the user is entering the name of a country, but you don't have a definitive list of all possible countries. The advantage is that the list will be self-updating; as the user enters new countries, they willl automatically become available for future use.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 

Take a look at faq184-1792 and faq184-1812.
Although I agree with Mike Lewis that the amount of records you have may slow down the combo's reaction.

Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
ReFox XI (www.mcrgsoftware.com)
 
From feedback the userexperience of incremental search is bad, even if you optimise _INCSEEK (interval between two keypressses before incremental search reverts to seek for the first letter). If you do a typo you need to restart, if you are too slow you need to restart, etc.

With the autocomplete feature the user can see what he typed already and can adjust that any time, he can be as fast or slow as he likes.

Advantage about the combobox is, you get an overview, but that's less helpful, when there are too many rows you'd need to scroll through. Nevertheless in an alphabetical ordered list you still can scroll to the area of interest quite fast, don't underestimate that usage, it's still helpful to all not knowing what exact to search for and it's usabel even with thousands of rows. But more in a grid or at least listbox than with a combobox, which first needs to pop up/drop down.

To combine both advantages of overview and searching as the user likes to, editing the search term, you could use a simple textbox above a grid and in it's interactivechange() do a SEEK with SET NEAR ON in the alias displayed in a grid below. Then users have the best freedom to find a record as they like. Perhaps create a seperat form for this kind of interface, if there is no place in the main form for a grid.

Bye, Olaf.
 
Hi Mike,

Thanks again for your assistance and I do appreciate all the help from the other experts as well. As I am still fairly new to VFP9, I am open to all different solutions. The articles I mentioned were prior to VFP9.

I have just tried the auto-complete and it is so easy. I have one question though:

1. Is there anyway I can list two columns, 1 being the actual data to go in the field and the other a description? I tried placing the description in the Memo field of the autocomplete table but it did not display.

This is a nice to have if possible.

Thanks
Sue
 
Sue,

No, unfortunately an auto-complete textbox isn't really designed for two-column working. It's not like a combo box, where you can display one set of values, and use a different set to insert into the field. With an auto-complete, what you type is what you get.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Thanks again everyone. The auto-complete solved the breed and colour drop-downs.

I will still need to use some form of a grid for the Vet + Vet phone number as this is the only combination that does require both columns to display and be updated. Thanks for your suggestion Olaf on this.

Sue





 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top