M
marc_donofrio
Hi
I am trying to get a do while loop to enter data in the relevant txt
boxes - if there are two bookings on a day then to put the details in
one text box - then move on to the next box, fill in the detaisl for
that day etc.
The problem is that when the rs hits end of file it crashes instead of
exiting this code and moving on to the next.
I hope some one can see where i am going wrong.
If Not rsBooking.EOF = True Then
For DayNum = 1 To 7
If rsBooking!Date = (ReneDate + (DayNum - 1)) Then
Do While rsBooking!Date = (ReneDate + (DayNum - 1)) And Not
rsBooking.EOF
Forms =
Forms &
Left(rsBooking![StartTime], 5) & "-" & Left(rsBooking![EndTime], 5) &
vbCrLf & rsBooking![EventTitle] & vbCrLf
Forms =
rsBooking![RoomID]
Forms = rsBooking![Date]
rsBooking.MoveNext
Loop
End If
If rsBooking.EOF = True Then
Exit For
End If
Next DayNum
End If
I am trying to get a do while loop to enter data in the relevant txt
boxes - if there are two bookings on a day then to put the details in
one text box - then move on to the next box, fill in the detaisl for
that day etc.
The problem is that when the rs hits end of file it crashes instead of
exiting this code and moving on to the next.
I hope some one can see where i am going wrong.
If Not rsBooking.EOF = True Then
For DayNum = 1 To 7
If rsBooking!Date = (ReneDate + (DayNum - 1)) Then
Do While rsBooking!Date = (ReneDate + (DayNum - 1)) And Not
rsBooking.EOF
Forms =
Forms &
Left(rsBooking![StartTime], 5) & "-" & Left(rsBooking![EndTime], 5) &
vbCrLf & rsBooking![EventTitle] & vbCrLf
Forms =
rsBooking![RoomID]
Forms = rsBooking![Date]
rsBooking.MoveNext
Loop
End If
If rsBooking.EOF = True Then
Exit For
End If
Next DayNum
End If