I am having a problem with a DoCmd.RunSQL strSQL working in some instances and not in others...
When the time provided in Me.txtBlockTime is either 10:00 or 14:00 the code fails. When the time is any other time it works. I have looked at the table and confirmed that records exist with the times of 10:00, 11:00, 14:00 and 15:00 as indicated in my tests. Those records exist and
Here is my code:
and here is a copy of the debug.print from 3 instances of running that code
Do you have any ideas why the sql statement would fail to work with at time of 10:00 or 14:00?
Thanks,
Bob
When the time provided in Me.txtBlockTime is either 10:00 or 14:00 the code fails. When the time is any other time it works. I have looked at the table and confirmed that records exist with the times of 10:00, 11:00, 14:00 and 15:00 as indicated in my tests. Those records exist and
Here is my code:
Code:
strSQL = "UPDATE MVIAppointments SET [ApptName] = '" & UCase(Me.txtReasonBlocked) & "', "
strSQL = strSQL & "[ApptReserved] = True, "
strSQL = strSQL & "[ApptCity] = '" & UCase(Me.txtReasonBlocked) & "', "
strSQL = strSQL & "[ApptEmail] = '" & UCase(Me.txtReasonBlocked) & "'"
strSQL = strSQL & " WHERE ([ApptDate] = #" & Me.calBlockDate & "#"
strSQL = strSQL & " and [ApptTime] = #" & Format(Me.txtBlockTime, "h:mm:ss") & "#)"
Debug.Print strSQL
DoCmd.RunSQL strSQL
and here is a copy of the debug.print from 3 instances of running that code
Code:
UPDATE MVIAppointments SET [ApptName] = 'TEST', [ApptReserved] = True, [ApptCity] = 'TEST', [ApptEmail] = 'TEST' WHERE ([ApptDate] = #2/14/2008# and [ApptTime] = #14:00:00#)
UPDATE MVIAppointments SET [ApptName] = 'TEST', [ApptReserved] = True, [ApptCity] = 'TEST', [ApptEmail] = 'TEST' WHERE ([ApptDate] = #2/14/2008# and [ApptTime] = #15:00:00#)
UPDATE MVIAppointments SET [ApptName] = 'TEST', [ApptReserved] = True, [ApptCity] = 'TEST', [ApptEmail] = 'TEST' WHERE ([ApptDate] = #2/14/2008# and [ApptTime] = #11:00:00#)
UPDATE MVIAppointments SET [ApptName] = 'TEST', [ApptReserved] = True, [ApptCity] = 'TEST', [ApptEmail] = 'TEST' WHERE ([ApptDate] = #2/14/2008# and [ApptTime] = #10:00:00#)
Do you have any ideas why the sql statement would fail to work with at time of 10:00 or 14:00?
Thanks,
Bob