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

Storing ComboBox Fields to a record 1

Status
Not open for further replies.

stanmurphy

Technical User
Oct 14, 2000
89
0
0

Hello All,

My form has a combobox pointing to a table.

My table is as follows:

Field1 Field 2
01 | Option 1
02 | Option 2
03 | Option 3
04 | Option 4


I want field2 to be displayed to the user, but have field1 stored in my data table when I save the data on the form. I know this is simple. Could someone please direct me to an existing answer. I can't find it.

Incidentally, I'm doing this to save space in my main data table as my form will have a number of these comboboxes pointing to different option tables. Is this the best way to do it?

Thank you,

Stan Murphy
 
stanmurphy

By default VFP's combo will display the first field first.

In your combo's rowsourcetype put FIELDS and in your Rowsource put myTable.field2,field1 and set to BoundColumn to 2 (in otherwords the value of the combo in this case will be field1 and the displayvalue will be field2).


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top