View Single Post
  #5  
Old March 26th, 2010, 07:19 PM posted to microsoft.public.access.gettingstarted
KenSheridan via AccessMonster.com
external usenet poster
 
Posts: 1,610
Default Gathering information

You don't have to remember the surrogate key values or even be aware of what
they are. Just use a combo box set up as follows whenever you need to select
an employee.

RowSource: SELECT EmployeeID, FirstName & " " & LastName FROM Employees
ORDER BY LastName, FirstName;

BoundColum: 1
ColumnCount: 2
ColumnWidths: 0cm;8cm

If your units of measurement are imperial rather than metric Access will
automatically convert the last one. The important thing is that the first
dimension is zero to hide the first column and that the second is at least as
wide as the combo box.

In a form based on a table with a foreign key EmployeeID column its
ControlSource would be EmployeeID.

The combo box will list the employees by name and you'll see the name in the
control when you make a selection, but its underlying value will be the
numeric EmployeeID value, which users never need see.

Ken Sheridan
Stafford, England

kmr wrote:
You suggest not using names as a primary key, and instead using auto numbers
or employee ID. I have a problem with, and maybe it's easy to solve and that
I'm just not thinking of it. So, I have one table with all my staff and an
employee ID and a second table with the employee ID and all the drill
information. When I go to enter new drills, I will either need to have all
employee IDs memorized or I will need to look at the other table to see what
the employee ID is. To me, this is creating more work. The reason I chose
to use first names was so that I don't have to memorize anything, and I just
type everything in without having to think. I have 80 staff, I really can't
try to memorize anything or have to look back each time to see what their ID
number is.

Whatever the final output format, start with a query which joins the two
tables on the First Name columns. If the Pass/Fail column is a Boolean

[quoted text clipped - 24 lines]
something so that it pulls only the fails from that column? Do I use a
query, form, or report for this?


--
Message posted via http://www.accessmonster.com