Hi,
I have a problem in relating 2 tables in a combo box based on two different keys. This is what it works:
Both tables are related by keys. When the Record Source on the form is the name of table (e.g. Table1).
In the Control Source of the Combo a key1 of the main table, then I enter in the Row Source:
Select key1, description from catalog
With several especifications, such as: Bound Column=1, Column Count=2 and Column Widths= 0 cm; 2.54 cm.
The form displays the description from the catalog and when I make changes in the combo box it make changes on Table1 (it changes the key).
The problem is when I have 2 or more keys in the relation:
I tried to do the following:
Record source: Field1, field2, CStr(key1) + "-" + CStr(key2)AS Hello From Table1;
Control Source (on combo): CStr(key1)+ "-" + CStr(key2) as Hello, Description from table2.
And the same requirements as before. The form returns the description correctly but I cannot make changes on the form, and it doesn't display any error.
I don't want to put any more code than necessary, but if I have to enter a macro please tell me.
Thank you!!!!
I have a problem in relating 2 tables in a combo box based on two different keys. This is what it works:
Both tables are related by keys. When the Record Source on the form is the name of table (e.g. Table1).
In the Control Source of the Combo a key1 of the main table, then I enter in the Row Source:
Select key1, description from catalog
With several especifications, such as: Bound Column=1, Column Count=2 and Column Widths= 0 cm; 2.54 cm.
The form displays the description from the catalog and when I make changes in the combo box it make changes on Table1 (it changes the key).
The problem is when I have 2 or more keys in the relation:
I tried to do the following:
Record source: Field1, field2, CStr(key1) + "-" + CStr(key2)AS Hello From Table1;
Control Source (on combo): CStr(key1)+ "-" + CStr(key2) as Hello, Description from table2.
And the same requirements as before. The form returns the description correctly but I cannot make changes on the form, and it doesn't display any error.
I don't want to put any more code than necessary, but if I have to enter a macro please tell me.
Thank you!!!!