Data Entry

S

steve

I have two tables; tblEmployees & tblProjects. The primary key for each of
these tables is an autonumber that the user never sees (EmployeeID &
ProjectID). Each project is associated with one employee (he's the
salesman).

So in frmProjects, I have put a combobox that queries the tblEmployees and
lists all of their first names so the user can choose one. I'm confused now
because I don't want the first name of the salesman stored in tblProjects. I
think I want it to store EmployeeID, which is the primary key of
tblEmployees. But like I said earlier, EmployeeID means nothing to the user,
so I don't want them to ever see it.

Thank you in advance for any help.
Steve
 
K

Klatuu

Make your combo multi column, containing both the name and the employeeId.
You can use the column widths property of the combo to hide the employeeid
and display only the name. Make the employeeId the bound column of the combo
and if the combo is a bound control, bind it to the employeeId rather than
the name.
 
S

steve

Thanks for the fast reply Dave! Makes perfect sense.

In general, is it a good idea to keep the primary key hidden from the user
like this? Are there any pitfalls to this?

Thanks,
Steve
 
K

Klatuu

Users should never see or even be aware of autonumber primary keys. You are
doing it the correct way.
 

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