By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,395 Members | 1,552 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,395 IT Pros & Developers. It's quick & easy.

How to make this loop?

P: n/a
All,
What am I doing wrong that it does not loop around employeeID?
This will create dates for the 1st employeeID, but then it stops. I
thought MoveNext goto the next Record (i.e. next employeeID) and then
fill in the dates again until it populates all the employees with
appropriate dates.

***********************************************
While (Not emp.EOF)

lngResourceID = emp![EmployeeID]

While dblCurrentDate <= dblEndDate
rstSchedule.AddNew
rstSchedule![EmployeeID] = lngResourceID
rstSchedule![WorkDate] = dblCurrentDate
rstSchedule.Update

dblCurrentDate = dblCurrentDate + 1
Wend

emp.MoveNext

Wend

************************************************

Sincerely,
Perry
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
pe******@yahoo.com (PerryC) wrote in
news:ea**************************@posting.google.c om:
All,
What am I doing wrong that it does not loop around
employeeID?
This will create dates for the 1st employeeID, but then it
stops. I thought MoveNext goto the next Record (i.e. next
employeeID) and then fill in the dates again until it
populates all the employees with appropriate dates.

***********************************************
While (Not emp.EOF)

lngResourceID = emp![EmployeeID]

While dblCurrentDate <= dblEndDate
rstSchedule.AddNew
rstSchedule![EmployeeID] = lngResourceID
rstSchedule![WorkDate] = dblCurrentDate
rstSchedule.Update

dblCurrentDate = dblCurrentDate + 1
Wend

emp.MoveNext
'you need to reset dblCurrentDate
'to the starting date here so that
'the while will work for the second
'(and subsequent) employee.
dblCurrehntDate = dblStartDate
Wend

************************************************

Sincerely,
Perry


Bob Quintal

Nov 12 '05 #2

P: n/a

That seems to be so obvious and I have read it again and again... and
yet missing that... Thank you Bob.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.