Expand|Select|Wrap|Line Numbers
- Dim rst1 As DAO.Recordset
- Set rst1 = CurrentDb.OpenRecordset("SETimes", dbOpenDynaset)
- With rst1
- Do While Not .EOF
- CurSDate = rst.Fields("STimes").Valuet
- MsgBox(CurSDate)
- CurSDateUK = CurSDate
- CurSDateV = DateAdd("s", -60, CurSDateUK)
- CurSDateVF = Format(Left([CurSDateV], 10), "yyyy-mm-dd")
- CurSTimeVF = Right(CurSDateV, 8)
- CurSDateV = CurSDateVF & " " & CurSTimeVF
- CurFSDate = Format(Left(CurSDate, 10), "yyyy-mm-dd")
- CurFSTime = Right(CurSDate, 8)
- CurSDate = CurFSDate & " " & CurFSTime
- CurEDate = rst.Fields("ETimes").Value
- CurEDateUK = CurEDate
- CurFEDate = Format(Left(CurEDate, 10), "yyyy-mm-dd")
- CurFETime = Right(CurEDate, 8)
- CurEDate = CurFEDate & " " & CurFETime
The previous loop I have in the code above this section works fine, but with this, it loops through until it reaches the end of the recordset (13 loops), but defines the 'CurSDate' variable as being the first record each time. I added a message box to demonstrate this, but I do not understand what is going on here. The table which the recordset opens has 13 different dates, each on their own numbered row - plus the same code seems to work earlier in the sequence.
Am I missing something here?
Thanks in advance,
-Craig