Synchronizing a Form and Subform

tdm32

New member
Local time
Today, 02:01
Joined
Sep 17, 2003
Messages
8
I have a Form which contains the employee information (Employee ID, Name, title, Phone) and a subform that contains the employees expenses(expense code, Hours, salary,expense, travel, Description)(it also contains Employee ID in the footer, this was done to sync the two well at least I thought) . All of the feilds on the form and the subform are contained in the same table.
The problem is that when I input the data into the form and then take a look at the Table, it contains two rows per entry. One row with the info in from the from with the feilds contained in the subform blank, and another row that contains the Employee ID, with the rest of the feilds from the main form blank, and the information from the subform displayed.

I'm confused. Shouldn't they automatically syc together being as though they're from the same table?

Any ideas or suggestions will be greatly appreciated.
 
You have a design flaw in that your data is not normalised.

The employees table should contain information dependant upon the employee such as EmployeeID, Forename, Surname (TIP: better to break the name up; harder to split ;) ).

Some of the information your have included in the employees table does NOT belong there: you need an expenses table with the EmployeeID of the employees table as a foreign key within your expenses table. This has its own key, best choice: ExpensesID.

Link these and your subform will work.


Also, there's a number of subform examples on this forum. Do a search to see some. I know I posted a few recently.
 
Mile-O-Phile said:
You have a design flaw in that your data is not normalised.

The employees table should contain information dependant upon the employee such as EmployeeID, Forename, Surname (TIP: better to break the name up; harder to split ;) ).

Some of the information your have included in the employees table does NOT belong there: you need an expenses table with the EmployeeID of the employees table as a foreign key within your expenses table. This has its own key, best choice: ExpensesID.

Link these and your subform will work.


Also, there's a number of subform examples on this forum. Do a search to see some. I know I posted a few recently.

Thanks for the advise:) . I'll try it and let you know how it works.
 

Users who are viewing this thread

Back
Top Bottom