main form and subform

G

Guest

I have a main form with a subform. The main form holds all personal employee
information and the subform will hold all the time employees will have missed
this year (by date) and they're related by SSN. The main form being the one
SSN to the many SSN in the subform. Each time I enter new data in the
subform it duplicates the employee record in the main form. I want to be
able to just enter data on the subform without altering the total number of
employee records I have.
 
A

Al Camp

Michelle,
Have you created a link bewteen the two tables in Tools/Relationships. It
sounds like you haven't, and your dealing with a "Cartesian" relationship.

You should connect the two tables via the SSN field, and specify a one to
many relationship.

1. First, make sure you have no dupe SSNs in tblEmployees, and there is
just one record for each employee, and each employee has a unique SSN.
2. Then...verify that you only have records in tblAbsent for legitimate
empolyee records in tblEmployees.
3. In Tools/Relationships... place your two tables on the workspace if
they don't show already
4. Click on SSN in tblEmployees, and "drag" to SSN in tblAbsent."
5. Select Enforce Referential Integrity, Cascade Update, and Cascade
Delete.
5. In Join Type select "Show all in Employees and Only those in Absent
where the two are equal"

If your tables are not normalized, Access may bark. If so post back and
we'll review what.
Try that, and we'll see how things go...
hth
Al Camp
 

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