D
Darrell Childress
I originally had a button that, when clicked, would run a macro. I now
need to write the VBA code for that instead, and need help. Here's what
I am trying to accomplish:
My form contains a field called TimeStop which contains Date/Time in the
format of 3/22/10 10:05:06 AM
I need to populate a field called DateStop and the value of that field
will depend on the TIME portion of TimeStop. If TimeStop is between
12:00:00 AM (midnight) and 5:00:00 AM, then I need DateStop to be the
current date - 1. Otherwise, I need it to be the current date.
Here's my stab at it, but I don't know the correct syntax to use
If TimeValue(Me.TimeStop) is between #12:00:00 AM# and #5:00:00 AM" Then
Me.DateStop = Date()-1
Else
Me.DateStop = Date()
End If
Thanks for any help,
Darrell
need to write the VBA code for that instead, and need help. Here's what
I am trying to accomplish:
My form contains a field called TimeStop which contains Date/Time in the
format of 3/22/10 10:05:06 AM
I need to populate a field called DateStop and the value of that field
will depend on the TIME portion of TimeStop. If TimeStop is between
12:00:00 AM (midnight) and 5:00:00 AM, then I need DateStop to be the
current date - 1. Otherwise, I need it to be the current date.
Here's my stab at it, but I don't know the correct syntax to use
If TimeValue(Me.TimeStop) is between #12:00:00 AM# and #5:00:00 AM" Then
Me.DateStop = Date()-1
Else
Me.DateStop = Date()
End If
Thanks for any help,
Darrell