View Full Version : Forms Filling from 2 tables


Paul R
07-05-2000, 11:54 AM
HELP!

Here is the problem: I have a database that has a table containing a list of employee names. There is a second table that I want to have show the number of products completed that day. I want to have a form similar to a datasheet view that will pull all the names from the "employee" table then display a blank field for the number of products (note: each person can work on up to 7 different items, so each of these fields needs to be enterable).
In addition, I want to have a single date field (instead of having a field beside each name). I think I have the date field figured out, but everytime I run my ideas, I get a form showing no names.
Here is the look I am thinking of:

Date:mm/dd/yy

Employee Prod1 Prod2 Prod3 Prod4...
Joe Blow (empty) (empty) (empty) (empty)
Jane Doe (empty) (empty) (empty) (empty)

I can do this with a single form by manually filling out the data, but we have new people entering all the time, and I want to automate this as much as possible.

This is the first time I have been trying to link up more than one field (been playing with sub-forms, but do not have a lot of experience in this and they never give me what I want!).

Any help would be appreciated. I can make this work as a web-page, but the boss does not want anyone having web access.... they all need to input their numbers directly into the database.

So.....HELP (again!)

KevinM
07-06-2000, 04:18 AM
You need to have FOUR tables, one for a general employee list, one for a general product list, one for your Product Header info and one for Products issued. Create a relationship via the Employee ID Between Product Header and Product Issued and then use a typical main form and sub form set up.

Product Header (main form)would have a field that looks up an employee from the Employess table and the date field.

Products Issued (Continuous subform) would include Product Description (looks up the Products table) as well as QTY, cost etc.

Whether or not each employee has 7 products or not is of no relevance, the whole point here is that they can have MANY products (1 or a million!).
Whatever you do DO NOT end up with a situation where you have one table with field names like Prod1, Prod2, Prod3 etc.
This is WRONG and I urge you to start again and 'normalize' your tables if you have done it this way.

HTH

Kevin M