Quote:
Originally posted by fly_phoenix
I can't seem to get the following done.
I have a database with 3 tables: 1 for Employees(table a) 1 for products(table b) and one for use of products by employees (table c).
Now I want to create a form in which a combo gives the opportunity to select one employee from table a, another combo gives the opportunity to select one product from table, and writes the selected choise down in table c.
But my combo only shows the first employee or product it can find.
How do I fix this?
And to make it more complicated, in the combo I want to see the description of the field, but in table c I want to write down the indentifier.
How can I do this? Anyone know?
It sounds like you are expecting VB to know what you want it to do without telling it. Assuming that you are using Data-Bound combo boxes for a and b, and that you want to limit the choices for a and b to the tables that they are bound to you need to decide which event will trigger the creation of a new entry in the third table. I would suggest using a data-bound grid for the third control, and I would suggest adding a command button to trigger the "Add Record" event. If you use this format then all you need to do is use an SQL statement to insert the new record into the third table when the "Add Record" event is triggered, you can then refresh the dbgrid control's data control to display only entries with that employee, product or both. I would suggest including a date field that has a default value of Now....but that is up to you. Remember that a bound control only displays data that is already in a table.