>A novice question while designing forms...
>
>I have two tables.
>
>Table1 with field1 (integer, index) and field2 (string)
>Table2 with field1 (foreign key from Table1) and other fields
>
>I am designing a form to add/edit records of table2. I am using a combo box which shows all the strings of field2 from table1. when updating the record in this form , I want to look up the corresponding value of field1 of table1 of the record selected in the combobox and save it to field1 of table2. Do the same while reading the record. I know can do it manually by writing code. Is there any way of setting the combobox properties and achieving this in a simpler way. This seems to be a common thing while developing database applications, I thought I would just ask.
>
>Thanx for your time.
>Puri
Hi Puri
(2nd try, this time with the whole message ...)
Set the following properties on the combo:
rowsourcetype = 3 - sql
rowsource = SELECT field2, field1 from table1 into cursor curLkup
controlsource = table2.table1_fk
columnwidths = 100, 0
boundto = .t.
boundcolumn = 2
style = 2 - dropdown list
that should do the trick.
----------
Mark Bucciarelli