Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bookings

Status
Not open for further replies.

anastasia

Programmer
Dec 13, 2000
111
GB
Hi I have the following code: The problem with the code is that when this code is implemented as shown below then the error message in the code below booking time entered is invalid always displayed when it shouldnt, however if I take out the above code comparing bookingdate and bookingtime then the other code works fine and vise versa. I was wondering if it was anything to do with having two loops the code is within a query which extracts data froma database. Any ideas welcome.

<%Do while NOT RS.EOF%>
<% IF RS(&quot;BookingDate&quot;) = bookdate AND RS(&quot;BookingTime&quot;) = time THEN %>
<% errorForm &quot;The Date and Time entered is already Booked.&quot; %>
<% END IF %>
<% RS.MoveNext%>
<%Loop%>

<%
dim found
found = false
Do while NOT RS.EOF
IF RS(&quot;Times&quot;) = time THEN
found = true
end if
RS.MoveNext
Loop

if not found then
errorForm &quot;Booking Time entered Invalid.&quot;
end if
%>
<%RS.Close%>

 
i expect a rs.movefirst is missing between the 2 loops. . . . br
Gerard
(-:

| Do it!
|
V
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top