how to disallow identical dates and times?
I'm doing this on the fly so your probably gonna have to play with it a little, but try this:
Code:
Set rsappointment = dbappointment.Execute("select * from app_date_time")
Do Until rsappointment.EOF
If rsappointment("app_date") = txtdate.Text And rsappointment("app_time") = txttime.Text Then
MsgBox "An appointment is already taken at that time. Please choose another.", , "choose another time"
Exit Do
Else
rsappointment.MoveNext
End If
If rsappointment.EOF Then
Goto continue
End IF
Loop
how to disallow identical dates and times?
hello guys! especially babbalouie who has been of a great help
it's me again with my senior project
i have a form that contains date and time fields for an appointment.
i must not allow 2 appointments to be taken the same date at the same time, so i did the following if statement but it is still allowing me to take 2 appointments at the same date and time!
what should i do? how do i correct it?
pls help ASAP
thanks
terry
Set rsappointment = dbappointment.Execute("select * from app_date_time")
Do Until rsappointment.EOF
If rsappointment("app_date") = txtdate.Text
And rsappointment("app_time") = txttime.Text Then
MsgBox "An appointment is already taken at that time. Please choose another.", , "choose another time"
Exit Sub
Else: GoTo continue
End If
rsappointment.MoveNext
Loop