Hello,
I am trying to find some simple code to update all records in a recordset in an access database. In this case, the recordset will be a query. Since the search engine is down, I was wondering if anyone could help. I will pseudo code what I want to do:
'project management database, startdate will be on a Monday, first Enddate will be the following Friday. Total work hours in a week will be 30.
Ask for Startdate
Enddate = Startdate + 5
totalhours = 0
'If the hours for the task (record) + totalhours is less than or equal 30, make the due date the Friday of the current week, else reset totalhours and add 1 week to Enddate, and make the due date the Friday of the next week
Do until end of recordset
If totalhours + hours <= 30
add hours to totalhours
move Enddate to duedate
Else
totalhours = 0
Enddate = Enddate + 7
add hours to totalhours
move Enddate to duedate
End If
Read next record
I am trying to find some simple code to update all records in a recordset in an access database. In this case, the recordset will be a query. Since the search engine is down, I was wondering if anyone could help. I will pseudo code what I want to do:
'project management database, startdate will be on a Monday, first Enddate will be the following Friday. Total work hours in a week will be 30.
Ask for Startdate
Enddate = Startdate + 5
totalhours = 0
'If the hours for the task (record) + totalhours is less than or equal 30, make the due date the Friday of the current week, else reset totalhours and add 1 week to Enddate, and make the due date the Friday of the next week
Do until end of recordset
If totalhours + hours <= 30
add hours to totalhours
move Enddate to duedate
Else
totalhours = 0
Enddate = Enddate + 7
add hours to totalhours
move Enddate to duedate
End If
Read next record