Store Employee ID in table, Display User Name in form


M

mbedford1

There are two tables and a form:
tblAssets
tblEmployees
frmAssets

tbleEmployees, among other things, has columns for User FirstName, User
LastName, and EmployeeID.

frmAssets primarily deals with tblAssets but pulls from other locations,
including tblEmployees.

frmAssets has field for EmployeeID, but not employees names.

There are two requirements:
1) When displaying entries in frmAssets, I want to see the employees name
corresponding to the EmployeeID stored for that asset record in tblAssets.

2) When entering new records in frmAssets, I want to be able to select the
appropriate employees name from a drop-down list and have it store the
corresponding EmployeeID value in tblAssets.

Can I do this simply using a query or coding and tblEmployees because it
already has both the EmployeeID and the names?

Or would it be better to build this using a query that concatenated First
and Last names and another update query, pulling from that concatenated name
list and converting names to IDs and IDs to names?

Or is there another way I'm missing altogether?
 
Ad

Advertisements

S

SuzyQ

change your employee id box to a combo box if it isn't already. then in the
row source property create a query that has both id and name from the
employee table, put the name first and sort it, set the column count to two,
set the bound property to 2, limit to list will automatically be set to yes
because you are not bound to the first column -

this will store id in the field, but display name and allow you to enter
name instead of id
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top