Copy value from current form to a table

LocalUser

Registered User.
Local time
Yesterday, 21:17
Joined
Apr 24, 2011
Messages
23
Hello Experts,
I have an urging issue that I desperately need to solve.
I’ll just explain the rational of my database before presenting the issue:
I have a projects Database with: Projects_Table, Staff_Table
Both tables has forms for data entry or update. Each project has many staff allocated to it.
In the Staff_Form I placed the “Project_Code” in the form heading section. The form opens based on a search criterion on the project_code so it shows the staff for that project only.
The issue is when I try to add a new staff for that project on the Staff_Form, the project_code stays blank in the staff_table. What I need is that the project_code in the staff_table for that newly added person to have the same project_code on the opened form. Simply to link the staff to the project they work in when I add them using the form.
How can I achieve that????
 
I'd give serious consideration to the design of your database as from what you've described so far, I'd be opening a Projects form to see all staff allocated.
The staff form would be used only to maintain staff details as I presume the relationships are such that one project can have many staff, but one staff can be involved in many projects.
In order to manage that you'd need to be viewing a project in order to add staff members allocated, that is the staff allocated to a project would be viewable as a sub form on your projects form and you could use the sub form to add new staff to the project.
This would require a third table call it 'tblProjectStaff' with minimum fields as such:
projectStaffID, Autonumber
projectID, FK to your projects table
staffID, FK to your staff table
other fields as necessary

David
 

Users who are viewing this thread

Back
Top Bottom