Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Best way to handle lookup
Message
From
13/11/1997 12:53:29
 
 
To
13/11/1997 12:47:15
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00059917
Message ID:
00059983
Views:
36
>>>Hi, I'm new to VFP (3.0b) and am hoping you will be able to help me with some ideas on the best way (user-interface wise) to lookup an indivual in a database. I have a database of 12,000 Alumni, and users need to lookup Alumni from the database useing one of several search criteria (lname, grad date, City, ID#, Company, etc). The initial search could produce multiple individuals (ex. lname="Brown" could produce 40+ Alumni) from which I would like the user to be able to select one. I would then display full Alumni information for the selected Alumni.
>>> My thought was to have a listbox holding the initial search criteria (lname, grad date, City, ID#, Company, etc.) and a textbox for the user to enter (for instance) the last name. When the user clicks on a FIND button, I would search the database, fill an array with the results, and bring up another listbox based on the array. The user would make his/her final selection here.
>>> Does this seem like the 'right' way to do it? Any other thoughts? Thanks in advance,
>>>
>>>Dave DeHaan
>>
>>Dave,
>>
>>There are many, many ways to find a record. Each one as individual as the programmer who created it. The 'best' way is really a matter of personal preference.
>>
>>One way that I've used lately seems to work pretty well.
>>
>>Using the same form that you use for data entry, create a 'search mode' so that the user can enter information into any of the available fields. When they press 'OK' (or 'GO' or whatever), a filter is set on the file to show only those records that contain the information entered. In your case, LName, City, etc.
>>
>>Since this is a relatively small table, the filter should not slow the system significantly.
>>
>>My users seem to like this method. Perhaps yours will too.
>
>Thanks Larry (and Eric),
> You have both given me some good ideas. When I said 'right', I probably should have said 'clean' or 'non-kludge'. Haveing one listbox bring up another seemed kind of cumbersome to me! I will look into implementing a search mode form that brings up a grid showing filtered records based on the user input. Using the column headers to re-order the records also appeals to me.
> I just want to make sure there won't be any significant performance issues using a grid on a filtered table of 12,000 records. Everything I have read so far (not all that much!) seems to indicate this should not cause too much of a problem... Thoughts?
>Thanks,
>Dave DeHaan

I try to stay away from filtering tables in my forms because of performance. If you activate a filter on a table and also have an index set on the table, things can get pretty slow, depending on the complexity of the filter. I prefer to base all the controls on the form on a cursor, and when the user enters criteria, requery the underlying table. Whether or not you use filters or not, you want to be sure and have indexes on every field that the user can query on and on deleted().
Erik Moore
Clientelligence
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform