Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Substitute for Combobox
Message
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01429152
Message ID:
01429399
Views:
72
>>>>Hi Gang!
>>>>
>>>>I have a combox that I am trying to populate from a table. I am pulling around 200,000 records into the combobox, but it takes around 30 seconds to do.... tooooo slow.
>>>>
>>>>Is there a substitute out there that can be used instead, that will mimick the combobox, but not take that much time to come up.
>>>>
>>>>Thanks!
>>>
>>>First of all - nobody ever needs that many chouces in a combobox (nobody). If they say they do, ask them to read all the choices and tell you about them.
>>>
>>>A grid is the only thing to use for that, and again, nobody needs 200000 records in a grid.
>>>
>>>Bad design (period).
>>
>>Well, except for the slow creation of the SQL, the combo worked sweet with a grid that it was feeding info to.
>>
>>The Combo would hold the names of the patients, and the user could select the patient or type in an incremental search to get close to it... (without the combo, the user will have to type in the name of the patient, and there is room for error there, and they may miss the name).
>>
>>Once the name was picked, this was used to SQL Select the sales for this patient and place in a grid so the user can select one of th e items sold for a refund.
>>
>>I will see about setting up a grid just for the patient names instead of the combobox.....
>>
>>Thanks!!!
>
>I actually wrote a classlib to deal with this exact problem....it was even patients ...haha
>
>What I did was make a textbox and a grid work together. The grid was invisible at the start. As the user typed into the textbox, the grid would appear, and every character the user typed, the grid would be filtered a bit more. I did this by using a remote view and passing 2 parameters - one was the number of characters they'd typed, the other was the characters they'd typed. Each character the user typed, the view would be requeryed and the grid below the textbox refreshed. I had mine setup so they had to type in at least 3 characters before it would start happening - this way there wasn't a huge amount of data to deal with...
>Also, in the textbox, I had it setup so that if the user hit the downarrow key, it took them to the grid .
>
>This has worked quite nicely for me and I've used it a bunch of times.
>
>Here is an example of one of my views that does this:
>gname is what the user has typed in thus far to search on...
>lnChars is the number of characters contained in gname...
>
>
>CREATE SQL VIEW "DEMOGRAPHIS_CHARTLIST_BY_PATIENTNAME_100_A_RVWRP" ;
> REMOTE CONNECTION "Conn_MED_Coding" ;
> AS SELECT Demographics.CHARTID, Demographics.HospMedRecNum, Demographics.ACCOUNTNUM, Demographics.HospCode, Demographics.DOS, Demographics.HOSPITAL, Demographics.FINCLASS, Demographics.LOCATION, Demographics.PatientAge, Demographics.PatientDOB, Demographics.PATIENTNAME, Demographics.PatientGender, Demographics.PTypeCode, Demographics.MaritalStatus, Chartlist.CHARTID, Chartlist.BATCHID, Chartlist.RecordTypeCode, Chartlist.AccountNumber, Chartlist.StatusCode, Chartlist.DateNew, Chartlist.DateCoded, Chartlist.DateFlagged04, Chartlist.coder_notes, Chartlist.LastChangedUser, Chartlist.LastChangeDate, Chartlist.procedure_notes FROM dbo.DEMOGRAPHICS Demographics INNER JOIN dbo.CHARTLIST Chartlist ON Demographics.CHARTID = Chartlist.CHARTID WHERE LEFT(Demographics.patientname,?lnChars) = ( ?lcgname ) AND Chartlist.StatusCode = ( 'New' ) ORDER BY Demographics.ACCOUNTNUM

Cool beans!!! Good idea!!!

I rewrote my form yesterday and resorted to using a UNIQUE key on ptnt_name for the GRID.

Smoking HOT!

And.... added an incremental search textbox that seachs the GRID for the patient name as you type.... sort of like what you described above...

Thanks!
Tommy Tillman A+ NetWork+ MCP
Previous
Reply
Map
View

Click here to load this message in the networking platform