PDA

Click to See Complete Forum and Search --> : ComboBox. Dont Understand


Steve Thomas
Feb 24th, 2000, 01:12 AM
I have a datagrid in my form. I have a combo box. The datagrid has a field called Employees ID. The combo Box displays the Employee ID. I have another table that has the employee name that is associated with the Employee ID. Is there a way to enter an SQL statement somewhere that will query the Employee ID against my table and display the employee name rather than the ID. I still want the ID to be stored in the Database. This is done in Access97 using an SQL statement in the RowSource.

Thanks

JohnAtWork
Feb 24th, 2000, 03:53 AM
I'm assuming you have two tables; one is let's say a Materials Table, and the other is an Employee table.

The Datagrid is based on Materials, with Employee ID being inside of it.

Use the following Select style:

SELECT [EMPLOYEE].EMPLOYEE_NAME
FROM [EMPLOYEE] INNER JOIN MATERIALS ON [EMPLOYEE].EMPLOYEE_ID = MATERIALS.EMPLOYEE_ID;

Let me know if this isn't what you were asking.

Steve Thomas
Feb 24th, 2000, 03:58 AM
I think I figured it out. I created two datagrids and used the DBCombo control and got it to work. Thanks for the help though.