Autofill doesn't fill in my table

G

Guest

I have a form where I fill in an employees name and in the next to boxes it
autofills the employee # and Department. I gotten this to work just fine
however when I go back to my table the onlly thing that is filled in is my
employee name. The employee # and department appear blank. Can anyone tell my
what might cause this? Thanks in advance.
 
G

Guest

Hi, Dahlman.

Generally speaking, an Employee name, Number, and their Department would be
stored ONCE in an Employees table. To identify an employee in any OTHER
table requires storage of only the primary key that uniquely identifies that
employee. This is the power of a relational database.

You can *display* any other fields on your form or in a report by linking
your table to the Employees table, and selecting those fields, and making the
query the RecordSource for the form or report, or by including the fields as
columns in a combo box, and referring to the cbox' Column property.

There are rare exceptions to this guideline, such as when you want to store
the current price of an item at the time of an order. In this case, you
would require VB Code to specifically write the value to the field, normally
in the ProductID AfterUpdate event, using a column from the ProductID combo
box, e.g.:

[CurrentPrice] = cboProductID.Column(2)

I don't believe this is your situation, however.

Hope that helps.
Sprinks
 
G

Guest

I have stored the name and number and department all in one table. But the
form that I am referring to is entering training information for each person.
So I type the name and then the number and department are autofilled. And
then I choose the field that they were trained in and what level of training
they completed. So I still need the number and department on the table.


Sprinks said:
Hi, Dahlman.

Generally speaking, an Employee name, Number, and their Department would be
stored ONCE in an Employees table. To identify an employee in any OTHER
table requires storage of only the primary key that uniquely identifies that
employee. This is the power of a relational database.

You can *display* any other fields on your form or in a report by linking
your table to the Employees table, and selecting those fields, and making the
query the RecordSource for the form or report, or by including the fields as
columns in a combo box, and referring to the cbox' Column property.

There are rare exceptions to this guideline, such as when you want to store
the current price of an item at the time of an order. In this case, you
would require VB Code to specifically write the value to the field, normally
in the ProductID AfterUpdate event, using a column from the ProductID combo
box, e.g.:

[CurrentPrice] = cboProductID.Column(2)

I don't believe this is your situation, however.

Hope that helps.
Sprinks



Dahlman said:
I have a form where I fill in an employees name and in the next to boxes it
autofills the employee # and Department. I gotten this to work just fine
however when I go back to my table the onlly thing that is filled in is my
employee name. The employee # and department appear blank. Can anyone tell my
what might cause this? Thanks in advance.
 
J

John Vinson

I have stored the name and number and department all in one table. But the
form that I am referring to is entering training information for each person.
So I type the name and then the number and department are autofilled. And
then I choose the field that they were trained in and what level of training
they completed. So I still need the number and department on the table.

No. You DON'T need the number and the department on the table.

If you can find the number and the department from the table of
people, then there is *no* good reason to store them redundantly in
the training table; you can just create a Query joining the people
table to the training table to pick them up.

You're using a relational database; one basic principle is what I call
the "Grandmother's Pantry Principle": "a place - ONE place! - for
everything, everything in its place."

If, on the other hand, you want the department name in the training
table to be allowed to differ from the department name in the persons
table, but to default to it, post back. It's doable; it's just
probably not necessary.

John W. Vinson[MVP]
Join the online Access Chats
Tuesday 11am EDT - Thursday 3:30pm EDT
http://community.compuserve.com/msdevapps
 

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