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

Combo box and textbox update

Status
Not open for further replies.

ninjaman01

Programmer
Aug 11, 2021
14
PH
Hi All,

Good day,

Can someone help on my problem?, My problem is i have a combo box and a textbox wherein when you change the value in the combo box it will change the value in the textbox too. for example the combo box value is "Freshman" then the value of textbox should be "1" then if you change it to "Sophomore" then the textbox should be "2" so and so forth.
 
Where is your data stored? Do you have a table which contains both the text values ("Freshman", etc.) and the corresponding numbers? If so, use that table to populate the combo. Set the ColumnCount to 2. If you don't want the user to see the numbers, set its column width to 0.

Then, in the combo's InteractiveChange, set the textbox's Value to the current value of the combo.

If your data is not in a table, let us know how it is stored.

Mike



__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Hi Sir thanks for your help, I already did what you said and it works however my tables have duplicate records for example freshman = 1, freshman = 2, sophomore = 2, sophomore = 3 something like this. when i choose a record for example freshman = 1 then i change freshman = 2 the combo box value has change from freshman to freshman but the value of textbox did not.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top