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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drop Down Boxes... is there a limit to the number of items...

Status
Not open for further replies.

GriffMG

Programmer
Mar 4, 2002
6,333
FR
I have an app (it's VFP6 based, and I'm not in a position to move it to VFP9 at the moment) that imports a list of customers from Sage accounts.

This list is then used with a drop down box to assign the Sage account reference to the customer in the application (the user who adds customers to Sage is not the same as the one who adds them to the app, so we cross reference them when needs be).

Today, for the first time with an app that - as you can guess - is more than a decade old, the drop down box is only showing the first few entries. The others are there, if the user types the whole Sage reference code, the drop down 'adopts' that entry and 'some' of those around it.

I think the drop down has come to some kind of limit - the rowsourcetype is 6. Fields and there are 'only' 168 entries in the table... has anyone come across this?

The problem seems to be a bit machine specific, my laptop does not exhibit the same problem with the same data.

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
Griff,

I recall setting SYS(2910) to a low-ish number once because some users were asking for fewer items to appear in the drop-down portion of a combo box (the other items were still there, but you had to scroll to see them). However, I have a feeling that this was not availablein VFP 6. Perhaps you could check?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
On second thought, I think SYS(2910) might refer to things like auto-complete textboxes (which were definitely not avaialbe in 6). So that might be a false lead.

The combo box has a DisplayCount property that determines how many items are displayed in the drop-down portion. Does that help at all?

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Hi Mike

I have changed the system somewhat, to use a pop-up list of Sage References within a grid, with a quick search option.
Same drop down with over 2000 entries works fine on my laptop, so had to dream something up pronto.
Turns out the system is now nearly 20 years old, not so much 10!

Not sure what was going on locally - perhaps it was an anti-virus thing (blame them for most 'unknowns' these days).



Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
The list should have a scrollbar. Visible items are fewer, but there is no practical limit to the listitems.

When used for autocomplete or incremental search as VFP calls that within a grid/combo/listbox, it works out OK, but with many customers, I'd go for a real autocomplete textbox instead, because then your incremental search can be seen and you may also program it in the way items are found in VS editor as instring-matches, too. Meaning with an autocomplete textbox you can use the default of "starts with" search, but you can override that if you like.

You don't just have the Autocomplete=4 (Custom) setting, which allows a custom weight for how items are sorted and presented for picking from them, you may use the InteractiveChange event to update the weight for all autocomplete table records, even in the case of a few thousand it's not getting sluggish.

It's advisable to prepare the data for such more intelligent choices, for example, separate customer names in first and last and search "begins with" for both last and first name. Give weight to recently picked, give a weight to context, ie customers more frequently related to a currently picked project/product/category/whatever, so have multiple autocomplete tables at hand and use one that's fitting for the situation of the form.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Customers PC had no scroll bar and only displayed the first six or so entries... the cursor would not move down below the sixth.
Same data and .exe on my laptop displayed scroll bar and all entries.

If customer type an entry that existed, it appeared, in the list, along with some of those around it!, still no scrollbar.

Weird.

Popup with grid works fine.

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
Native combobox...

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
Yes, it does look weird. I don't recall seeing this particular behaviour before.

I've seen cases where a combo or listbox with more than a couple of hundred entries became so slow as to be unusable, but that only applied in the very early versions of VFP. I'm pretty sure it was fixed in 6. And in any case, it doesn't explain the exact behaviour you are seeing.

If you have a grid with quick search working, that's fine. I won't suggest you change that. But, in general, I agree with Olaf that a textbox with auto-complete enabled has several advantages. It is easier to implement than a combo box or grid; you can fix it so that the user's most recent entries or most frequent entries appear first; and the user can see all the matching entries - and only the matching entries - as they type.

One disadvantage of this approach is that there is no guarantee that the items presented in the drop-down correspond to records that actually exist. For example, if you search for a customer, then delete that customer, then search for the same customer again, the customer's name will continue to appear even though it no longer exists. I've had users complain about that. You can get round it by maintaining your own autocomp table, although that involves a little extra work.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
I can only think it could be a FILTER effect, but you'd also have that with the grid, ie only see the customers in the current filter.

If the grid solves it to you, I wouldn't worry too much about it, as the grid also offers other possibilities - a better look of items, for example. The combo also allows multi-column layouts, but no coloring or other ways of highlighting.

Bye, Olaf.

Olaf Doschke Software Engineering
 
Gonna stick with the grid, customer has a fix in place - so she's happy!



Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
Any chance you have DisplayCount set to some large value for that combo. Your message tweaked a vague memory and I found that I wrote this in HackFox:

DisplayCount isn't choosy enough about what values it accepts. It'll let you specify 0 or a negative number. In VFP 6, in that case, it ignores you and just displays seven items. In VFP 7, setting DisplayCount negative displays the number of items you've set for List Display Count.

More seriously, when you make DisplayCount big, the list doesn't even show up when you drop the combo open. On Tamar's system, things start getting weird once DisplayCount gets over 50 and, by 130, the list doesn't even show up or appears way above the form. In between, there are some other weird behaviors. The moral of the story is to choose reasonable values for DisplayCount.
 
I will need to drag out a back-up to look.
Seeing as I have zapped the original control.
But good idea Tamar

Regards

Griff
Keep [Smile]ing

There are 10 kinds of people in the world, those who understand binary and those who don't.

I'm trying to cut down on the use of shrieks (exclamation marks), I'm told they are !good for you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top