I have a loop using the database JobCost to look at the field del_date and I've inserted a MsgBox that shows me the data in del_date. I loop through the database but the del_date never changes from the first record. What am I doing wrong?
Do While rsJobCost.EOF = False
rsJobCost.MoveNext
MsgBox Left(del_date, 4)
If Left(del_date, 4) <> YearTxt Then
YTD = YTD
End If
If Left(del_date, 4) = YearTxt Then
YTD = YTD + Tot_Sales
End If
Loop
Do While rsJobCost.EOF = False
rsJobCost.MoveNext
MsgBox Left(del_date, 4)
If Left(del_date, 4) <> YearTxt Then
YTD = YTD
End If
If Left(del_date, 4) = YearTxt Then
YTD = YTD + Tot_Sales
End If
Loop