Link to home
Start Free TrialLog in
Avatar of Richard Teasdale
Richard TeasdaleFlag for United Kingdom of Great Britain and Northern Ireland

asked on

value in combo box vfp

HI:
Probably simply answered but here goes:
Two tables; one salesmen, the other cities. A Form accessing the salesman has a drop down combo box accessing the city. So a salesman can be allocated to New York City, for example. However, the field 'city'  in the salesman table is a number, joined to the primary key (also a number) in the city table. The name is a descriptive text field in the city table.
So when a user views the combo field on the salesman form he does not see 'New York City" he sees the number that represents it - 1.  Is it possible in vfp to have the name of the city, drawn from the city table, visible in the combo box, rather than its reference number of 1?
Thanks!
Avatar of Cyril Joudieh
Cyril Joudieh
Flag of Lebanon image

It needs to be initialized to the city's name.

IF SEEK(salesman.city, 'cities', 'id')
    cCity = cities.city
ENDIF
ASKER CERTIFIED SOLUTION
Avatar of Olaf Doschke
Olaf Doschke
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Richard Teasdale

ASKER

Simple when you know how! Thanks to you and Captain Cyril. Have chosen yours for no real reason, but it works. Good enough for me!