Auto fill

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i have tow tables, one consist of employees ID and their names, Employees,
and the other one consists of employeeID and other data about him, EMPEval.
These two tables are connected via the employeeID. my question, i need, when
i enter the EmployeeID in the field of the second table, i want the other
field, the employeename, to be automatically filled with his name according
to the data saved in the Employees table.
?? help
 
Then include the fields from both tables in your form.

You should not have the name stored in both *tables*. That would be
redundant. What if the person gets married or divorced; you don't want to
go change two tables.

The proper way to do this is to include both tables in your queries, forms,
and reports. When you want to display or print the name, pull those fields
from the Employees table.

Hope that helps.
 
no no no... ur not getting what i want... i did that before... but it doesnt
make sense to keep on writing and memorizing each employee's name according
to its number, so i saved them on a seperate table, and on the other table i
displayed this field to be filled with the user, and yet as a user,
automatically, need to see this number belongs for whom, which to be
retrieved automatically from the other table.
 
Are you entering data directly in the table? If so, you really should change
and have the users enter data in a form. The you use both table to make the
form so the user will see the name and number if both are desired or just one
of the two. You could use a combo box based on the table that stores the
names, and have it display how you would like. You only need to store the
names in one table and like Rick said base your forms and reports off both
tables.
 
You don't enter it multiple times in your "other" table. This is not a
spreadsheet, it is a database. You don't need the employee's name in your
table, just the number.

For example...



EmployeeData
EmployeeNumber
EmpFirstName
EmpLastName
EmpMiddle
EmpStartDate
etc.

EmpEvaluations
EmpNumber
EvaluationDate
OverallScore
etc.


See, in the evaluations table all you need is the employee number. You
don't need the name in that table. In your forms, queries, etc. you pull
data from both tables. To print an evaluation report, you would pull all
the data from the EmpEvaluations table, plus you'd pull the Name from the
EmployeeData table. Each employee will have only one record in the
EmployeeData table. They will have many records (maybe one each year?) in
the Evaluations table. You would NOT store the employee name for every
evaluation. If you do, you are "committing spreadsheet".

Hope that explains it a bit better.
 
nice_evest said:
i have tow tables, one consist of employees ID and their names,
Employees, and the other one consists of employeeID and other data
about him, EMPEval. These two tables are connected via the
employeeID. my question, i need, when i enter the EmployeeID in the
field of the second table, i want the other field, the employeename,
to be automatically filled with his name according to the data saved
in the Employees table. ?? help

You eliminate the employee name from the second table and set a
relationship between the two tables so your queries, forms and reports can
display the name information based on the ID number.

You are working with a relational database not a spreadsheet. :-)
 
Note that the part of your post that is not correct is "and on the other
table i displayed this field to be filled with the user". You don't need
the name in the other table. You only store a piece of data once. Then you
relate the different tables. That is the whole point of a "relational"
database.

Again, hope this helps!
 

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