Copy data from a form to another

CosmaL

Registered User.
Local time
Today, 17:44
Joined
Jan 14, 2010
Messages
94
Goodmorning to all!

Guys,

My problem is the following:

I've got a database for safety accidents/incidents. I've a table for incidents and another for employers with fields:

tablename:tblEmployers, formname:frmEmployers
EmpID
FullName
EmploymentDate
BirthDate

In the Incidents form, i've a button which loads the frmEmployers with datasheet view.

Is it possible, by clicking/dbclicking on specific employer, his data (empid, fullname, etc) to autofill/copy to the same fields in form of incidents and save the record?

I've tried with combobox selection(Employers fullname) and autofield, but record didn't save the autofill data.

Thanks in advance!

Costas
 
Your requirement breaches normalization. Incidents should refer to the Employer by EmpID and only display the original data from the tblEmployers rather than repeating it.

Put Incidents form as a subform of the Employers form and any records added to the subform will automatically be designated with the EmpID, provided you set up the subform properly.

BTW. I supect Employers should be Employees.
 
Thank you for the answer, but the main form is the incidents, the employee will be mentioned only in these fields (fullname,employmentdate,birthdate).

There are more than 30 fields in the form...i can't make it as subform...

It'd be better to have employees (by empid) as subform...
 
The structure of the tables is dictated by the nature of the data not the layout of the forms.

There is one birthdate, one employment date and one full name for the employee. There can be multiple incidents. The employee details should be recorded once, in the employee table, not multiple times in the incident table.

You need to study Normalization before you continue developing your database or you will soon get into a real mess.
 
Goodmorning!

I don't disagree with you, but the current project just saves incident and then it prints it/makes pdf. Statistical analysis is being performed with excel (export table). The reason is that i have to create so many different charts (about 20) and the best is by excel.

So, i just need to copy the employee data as information, nothing more that could cause mess!
 

Users who are viewing this thread

Back
Top Bottom