I have the following code set up in my database:
Dim dDate As Date
Dim sCurrentTime As String
Dim sEventTime As String
dDate = Date + 1
sTime = "03:00:00 AM"
sEventTime = dDate & " " & sTime
Do Until sCurrentTime > sEventTime
sCurrentTime = FormatDateTime(Now(), vbGeneralDate)
Loop
blahblahblah
What is supposed to happen (and did happen until today) was that the code would run a continuous loop until tomorrow's date at 03:00:01 AM. For example, if executed today, sEventTime = "08/10/2004 03:00:00 AM", and sCurrentTime continues to reset, beginning with "08/09/2004 7:53:30 PM" or whatever.
For some reason, VBA assumes the loop has met this argument and goes on to execute the next line of code (symbolized by the blahblah line). In debug mode, both sEventTime and sCurrentTime are populating correctly, yet it thinks the argument has been met. I checked our system date, but that shouldn't matter, since the code always sets to execute at the system date + 1.
This is a very strange problem... any thoughts?
Thanks,
Paul
Dim dDate As Date
Dim sCurrentTime As String
Dim sEventTime As String
dDate = Date + 1
sTime = "03:00:00 AM"
sEventTime = dDate & " " & sTime
Do Until sCurrentTime > sEventTime
sCurrentTime = FormatDateTime(Now(), vbGeneralDate)
Loop
blahblahblah
What is supposed to happen (and did happen until today) was that the code would run a continuous loop until tomorrow's date at 03:00:01 AM. For example, if executed today, sEventTime = "08/10/2004 03:00:00 AM", and sCurrentTime continues to reset, beginning with "08/09/2004 7:53:30 PM" or whatever.
For some reason, VBA assumes the loop has met this argument and goes on to execute the next line of code (symbolized by the blahblah line). In debug mode, both sEventTime and sCurrentTime are populating correctly, yet it thinks the argument has been met. I checked our system date, but that shouldn't matter, since the code always sets to execute at the system date + 1.
This is a very strange problem... any thoughts?
Thanks,
Paul