I have a table TblServicebySerialSummary
one field is a next service date. the interva is based on the formula (365 / (AvgRunHrs / ServiceInt))
I want to take the first date in first record of the field [plannedServicedate] to stay as it is, but the next record the date should read + (365 / (AvgRunHrs / ServiceInt)) and the 3rd record should read the vlaue of the second row + (365 / (AvgRunHrs / ServiceInt)) etc etc.
First of all I tried to create this code but it failed miserably
first of all I got this message
the microsoft Jet database engine cannot find the input table or query ....
hwr I am sure that there is a lot wrong with this code...
Help Anybody .....
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim f As Date
Dim g As Integer
g = (365 / (AvgRunHrs / ServiceInt))
Set db = CurrentDb()
Set rs = db.OpenRecordset(TblServicebySerialSummary)
With rs
.FindFirst [plannedServicedate]
.MoveNext
[plannedServicedate] = [plannedServicedate] + g
f = [plannedServicedate]
Do While Not EOF(1)
.MoveNext
[plannedServicedate] = [plannedServicedate] + g
f = [plannedServicedate]
Loop
End With
one field is a next service date. the interva is based on the formula (365 / (AvgRunHrs / ServiceInt))
I want to take the first date in first record of the field [plannedServicedate] to stay as it is, but the next record the date should read + (365 / (AvgRunHrs / ServiceInt)) and the 3rd record should read the vlaue of the second row + (365 / (AvgRunHrs / ServiceInt)) etc etc.
First of all I tried to create this code but it failed miserably
first of all I got this message
the microsoft Jet database engine cannot find the input table or query ....
hwr I am sure that there is a lot wrong with this code...
Help Anybody .....
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim f As Date
Dim g As Integer
g = (365 / (AvgRunHrs / ServiceInt))
Set db = CurrentDb()
Set rs = db.OpenRecordset(TblServicebySerialSummary)
With rs
.FindFirst [plannedServicedate]
.MoveNext
[plannedServicedate] = [plannedServicedate] + g
f = [plannedServicedate]
Do While Not EOF(1)
.MoveNext
[plannedServicedate] = [plannedServicedate] + g
f = [plannedServicedate]
Loop
End With