|
-
Apr 28th, 2001, 03:48 AM
#1
Thread Starter
Hyperactive Member
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
VB6.0 SP4
Windows 2000
I'm thinking of a number between
-
Apr 28th, 2001, 05:06 AM
#2
Member
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
-
Apr 28th, 2001, 05:20 AM
#3
Member
I'm new at this myself but I'd try
If rsappointment("app_date")>0 or = txtdate.Text
And rsappointment("app_time")>0 or = txttime.Text Then
Just to give the argument that the date/time slot may be taken.
If a man talks to himself , And his wife doesn't hear him. Is he still wrong ?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|