Multiple Record entries on a single form

m17347047711116

Registered User.
Local time
Today, 08:31
Joined
Feb 4, 2002
Messages
68
Situation Description:

i have entered my employee vacations using the following fields:

[AutoID] Number access assigns unique KEY
[Employee Number]
[First Name]
[Last Name]
[Vacation Date]

Problem:
A)
I would like to display all the records for a given employee on a single form for editing and viewing purposes but i do not know how to display multiple records on a single form. It would be nice if i could bring up the single form enter the employee Number and have the form show the employee details in the header and in the body show each date the employee is to be on vacation.

Please Help

B) Is there a better way
 
You need to use a subform and two linked tables to get the functionality you're asking for. However, this is very easy and one of the things relational databases are designed to do.

Your main table should have all of the person-specific data, EmployyeNumber, FirstName, LastName, VacationDaysAvail, etc.
Your secondary table (call it VacationDetails for example) will have it's own, separate primary key. Then it will have a Long Integer field that you can label EmployeeNumber. This will form what's called a foreign key, linked to the primary key on your main table.
Open Tools>Relationships and draw a line between the two connected fields. It should prompt you to make this a One-to-many relationship. Now you can have (one) employee with (many) vacations.

Design your main form and leave space for a section about the vacation days (your current form probably has something like this already). Insert>Subatasheet/Subform and follow the wizard's instructions for making a new subform. If you're comfortable with form design, build a form just for your vacation data before this step and then insert that the same manner.

I hope that was clear. Post back if you need more help.

David R
 

Users who are viewing this thread

Back
Top Bottom