Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding Blank Records to a Table

Status
Not open for further replies.

Vette00

Programmer
Oct 8, 2006
21
US
I have a form the pulls up contractor info then I want to build the jobs for next week based on the needs of the contractor. Then later on in the week I assign employees to the jobs. I can't seem to figured out the best way to add the records without manually starting each record. Example(Company ABC wants to hire 3 people a day for Monday, Tuesday, and Thursday all starting @ 7 AM. I need to figured out how to generate 9 records with no one assigned for the days and the start time. I want to select the days and the # people and then later in the week go to the Assignments Form and assign people to the jobs needed.
 

There should be a textbox for the number of people (txtPeoples) on the form, which should end a loop of adding records to your table and one textbox for the number of days(txtDays)

Dim iPeople as Integer, iDays as Integer

For iPeople = 1 to txtPeoples.Value
For iDays =1 to txtDays.Value
code that adds the record to the table
Next iDays
Next iCount

For next monday use
dateadd("d", 7-Format(Date, "w") + vbMonday,date)

In your loop modify it to use the iDays variable
dateadd("d", 6-Format(Date, "w") + vbMonday+iDays ,Date)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top