Go Back  Xtreme Visual Basic Talk > Legacy Visual Basic (VB 4/5/6) > Database and Reporting > Adding Multiple records to a table with Single event


Reply
 
Thread Tools Display Modes
  #1  
Old 11-30-2002, 12:08 AM
dpdsouza dpdsouza is offline
Regular
 
Join Date: Oct 2002
Location: India
Posts: 80
Default Adding Multiple records to a table with Single event


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
Reply With Quote
  #2  
Old 11-30-2002, 04:07 AM
Shurik12 Shurik12 is offline
Steppe Walker

Retired Moderator
* Expert *
 
Join Date: Jul 2002
Location: Ukraine/Russia/Belgium
Posts: 7,227
Default

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.
__________________
"A diaper is not like a computer that makes satisfying burbling noises from time to time, hinting at great inner complexity." Malcolm Gladwell

"I'm sitting here completely surrounded by no beer." Onslow, 'Keeping up appearances'
Reply With Quote
  #3  
Old 11-30-2002, 04:29 AM
dpdsouza dpdsouza is offline
Regular
 
Join Date: Oct 2002
Location: India
Posts: 80
Default

Thanks Shrunik , I gonna try this now,

thanks again,
dennis.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->