|
-
Apr 11th, 2005, 10:10 AM
#1
Thread Starter
Addicted Member
Another SQL statement question....[NOT RESOLVED!!]
Hey everyone, I have a form which allows you to change the time of one of your events and I want to first check to see if there is an event already scheduled for the specified time.
Here is what I have so far:
Code:
SQLstmt_cal = "SELECT Appointment.Date, OpenHouse.Date, Showing.Date, ToDo.Date FROM Appointment, OpenHouse, Showing, ToDo " & _
"WHERE (Appointment.Date = " & "#" & dt_Date & "#" & " And Appointment.Time = " & "#" & dt_Time & "#" & ") Or " & _
"(OpenHouse.Date = " & "#" & dt_Date & "#" & " And OpenHouse.Time = " & "#" & dt_Time & "#" & ") Or " & _
"(Showing.Date = " & "#" & dt_Date & "#" & " And Showing.Time = " & "#" & dt_Time & "#" & ") Or " & _
"(ToDo.Date = " & "#" & dt_Date & "#" & " And ToDo.Time = " & "#" & dt_Time & "#" & ")"
Debug.Print SQLstmt_cal
Set MyRecSet_cal = New ADODB.Recordset
MyRecSet_cal.Open SQLstmt_cal, MyConn_cal, adOpenDynamic, adLockOptimistic, adCmdText
If MyRecSet_cal.BOF = False Then GoTo RecordFound
Debug.Print = SELECT Appointment.Date, OpenHouse.Date, Showing.Date, ToDo.Date FROM Appointment, OpenHouse, Showing, ToDo WHERE (Appointment.Date = #4/14/2005# And Appointment.Time = #12:00 PM#) Or (OpenHouse.Date = #4/14/2005# And OpenHouse.Time = #12:00 PM#) Or (Showing.Date = #4/14/2005# And Showing.Time = #12:00 PM#) Or (ToDo.Date = #4/14/2005# And ToDo.Time = #12:00 PM#)
For some reason the statement doesnt detect when there is a record already existing.. can anyone help me out??
Last edited by epod69; Apr 11th, 2005 at 02:27 PM.
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
|