On Feb 8, 2:59 pm, "Volatol via AccessMonster.com" <u30824@uwewrote:
In my form header I have fields for Employee Name, Employee ID #, Vehicle
Type, Vehicle #, Classification, etc. I want to be able to click the drop
down list and select the employee name. After the emloyee name is selected I
would like all of the other fields to pre populate with that employee's info.
Do I need two different tables with a unique Identifier for each employee
with some sort of validation process through a query? Is that completely
wrong and there is some other way to do this? Any suggestions would be
greatly appreciated.
--
Message posted viahttp://www.accessmonster.com
If you can get all the data from a single table or a query, then you
could use that table/query as the rowsource for your combobox and just
hide all the other columns by setting their widths to 0. then you
could just set the controlsource for each of the textboxes to
=cboEmployee.Columns(n) where n is a number starting at _zero_. (Just
subtract one from the ordinal position).
For example, if you wanted to see the employee's First name in a
textbox, and the rowsource for the combobox is something like
"SELECT [Employee ID], [Employee Name], [Vehicle Type], [VehicleID],
[Classification]
FROM Employee
WHERE...
ORDER BY [Employee Name];"
Then you'd set all the hidden columns (0,2,3,4) to zero in the Column
Widths property {0;1;0;0;0}, and then in your form, you would put your
textboxes and then just set the rowsource to cboEmployee.Columns(2)
for Employee Name. If you test it out with a couple of numbers,
you'll get it pretty quickly.
HTH,
Pieter