Name Validation

  • Thread starter Thread starter Rpt_Me4NotBeingSmart
  • Start date Start date
R

Rpt_Me4NotBeingSmart

I am creating a table where hundreds of entries will be entered daily. One of
the fields will be employee name in Last, First format. My form is a data
entry datasheet. I want the employee names to be checked as entered to
prevent mispellings. How can I do this? I know I have to create a table of
employees but don't know how to connect the dots. I know I am very close to
the answer but sheesh...
 
If you are entering employee names from an existing roster (an Employee
table, typically) you should have each employee record in that table have an
unchanging key field. It could be EmployeeID, if you use those, or an
Autonumber field, or a number field that you set up to increment
automatically. In any case you would have something like this:

tblEmployee
EmployeeID (Number field; primary key)
FirstName
LastName
etc.

Base a query on this table, using just the EmployeeID, LastName, and
FirstName in that order, sorted by LastName and FirstName. You could
combine first and last names in a new query field. At the top of a blank
column in query design view:
FullName: [LastName] & ", " & [FirstName]. In this case the query could be
EmployeeID, FullName, sorted by FullName.

Use the query as the Row Source for the combo box bound to the field in
which you want to store Employee information. Note that you will be storing
the EmployeeID, not the name. If an Employee's name changes I assume you
will want records created with their old name still to be available. It is
similar to the IRS using your SS# rather than your name to keep track of
your tax information. I am not suggesting you use SS# in the database, by
the way.

If you are using the query with FullName there are just two columns in the
query. Set the combo box Row Source to the query. To do this, use the
arrow to the right side of the Row Source row on the Property Sheet. To
view the Property Sheet click the combo box to select it, then click View >>
Properties (or right click and select Properties). In either case you need
to be in Form design view. Click the Format tab on the Property Sheet. Set
the Column Count to 2 and the Column Widths to something like 0";1.5".
Click the Data tab and set the Bound Column to 1.

This is all very general, since I don't know the purpose of the data entry,
or anything about the database's purpose or structure.

You may find this tutorial helpful:
http://allenbrowne.com/casu-22.html
 
I am creating a table where hundreds of entries will be entered daily. One of
the fields will be employee name in Last, First format. My form is a data
entry datasheet. I want the employee names to be checked as entered to
prevent mispellings. How can I do this? I know I have to create a table of
employees but don't know how to connect the dots. I know I am very close to
the answer but sheesh...

The solution is not to store the employee's name AT ALL, in the second table.

Relational databases use the "Grandmother's Pantry Principle": "A place - ONE
place! - for everything, everything in its place". The employee's name should
be stored once, and once only, in the Employee table - noplace else!

Your other table should store only the unique EmployeeID, the primary key of
the employee table. The name can be looked up whenever it's needed using a
Query, or a Combo Box on a form, or various other ways - but it need not and
should not be copied into your second table.
 

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

Back
Top