Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can you make a textbox behave like a combobox?
Message
From
05/04/2001 13:50:24
Jorge Haro
Independent Consultant
Juarez, Mexico
 
 
To
05/04/2001 09:19:00
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00492134
Message ID:
00492443
Views:
21
PMFJI, but I'm doing something similar in my current project, I'm using ADO, but the process is still the same. For this situation I've created a textbox class with some extra properties:

1. The table to search
2. The field to search
3. A list of captions
4. A list of field names

3 and 4 are used to send as parameters to a generic list form, that I use to pick the desired record

In the Valid method I look for the entered value in the indicated table, if I find an exact match I use it, otherwise I show the list so the user can pick a record.

I'm updating the appropiate field manually in each instance(I'm actually wondering why), but it could also be automatized, following the same mechanism.

Showing the right value when you change records would require two things

1. To set up a relation between your main table and your look up table
2. Set the value in the textbox's refresh method (which my class already does)

Also you could probably have a seek() in the refresh method, to avoid using a relation.

If you need more details let me know.

>>Hi Jim,
>>You do it by NOT binding the textbox to a field. Let the user enter the state code, then in Valid or LostFocus do a lookup and store the correct ID to the table. Another way is to use a popup grid instead of a combo so that users can see 2 or more fields. I've done this with lookups of 35,000 records.
>>
>>HTH
>>Barbara
>>
>>
>
>Okay, I see that, but then how do you update the display value when someone moves to another record?
Previous
Reply
Map
View

Click here to load this message in the networking platform