erich.wanker Posted October 18, 2021 Share Posted October 18, 2021 Hi: Question-example - i have 2 tables: table1: colors fields: color_id, color_name table2: master_thing fields: painting_id, painting_name , color_id, color_name if a user select a color in a UniDBLookupComboBox (items are from table colors) - in table master_thing should store 2 values (color_id, color_name) ThanX for suggestions Erich Quote Link to comment Share on other sites More sharing options...
mierlp Posted October 18, 2021 Share Posted October 18, 2021 Hi Erich In table2 you create a lookup field, let's say showColorName: Lookup definition: Key Fields : color_id Dataset : colors Lookup keys : color_id Result field : color_name For selecting the color you use a dblookupcombox so: datafield : color_id dataset : master_thing listsource: colors listfield: color_name keyfield: color_id When user selects a color from the colors table the color_id is stored in datafield and dataset For saving the name you can then use a table2.onbeforepost with something like: table2.color_name.value := table2.showColorName.value Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.