Adding Multiple records to a table with Single event

dpdsouza
11-30-2002, 01:08 AM
Hi Friends,

I am developing a payroll package using vb & access.

I have a payroll form through which I Generate the record of each employee manually one by one.

I have the master table for the Employee information( emp table) & Salary information (salary table) which i update once in a year when the revision of salary takes place.

The payroll is generated on a monthly basis.

Though the generation of payroll is same for all the employees, I have to go through the records of each employee every month & generate his payroll.

Is there any logic through which the payroll for all the employees is generated with the execution of one event ( Such as clicking a command button )

After generation of one event the records should get added to the payroll table one by one.

In other words , Is there any mechanism by which multiple records can be added to the access table with the generation of one event ?


Pls help.
with many thanks,
Dennis.

multiple records can be added to the access table with the generation of one event ? once in a year payroll for all the employees is generated with the execution of one event

Shurik12
11-30-2002, 05:07 AM
Hi,

one of the ways to do it is:
(assuming that you've already opened the recordset based on the table you want to add records to (rs2) and the recordset
containing the records to be attached (rs1)

rs1.MoveFirst


Private Sub Command1_Click

Do Until rs1.EOF
rs2.AddNew
rs2.Fields(i)=rs1Fields(i)
.....
.....
rs2.Update
rs1.MoveNext
Loop

End Sub


Regards,
Shurik12.

dpdsouza
11-30-2002, 05:29 AM
Thanks Shrunik , I gonna try this now,

thanks again,
dennis.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum