-
I know you can get the current date by using:
Text1.Text = Date
However, I'm going to be using this to automatically place the date in a Invoice form. This form may be left running on the computer over night and so I want to be able to have the date automatically roll over to the next day at midnight. I could do this using a Timer, but then I would have to have the timer constantly updating the date, and I don't want that. Is there any way to have VB just passively monitor the date, or have it tap into some API that would signal VB when the date has changed? Thanks.
------------------
Ryan
-
Why don't you just verify the Date before closing/resetting the Form?
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
-
Gimpster,
Sounds like you need to use the Now function.
If your program is running, this will do it for you.
Code:
Option Explicit
Private Sub Form_Load()
Timer1.Interval = 1000
End Sub
Private Sub Timer1_Timer()
If Time > #11:59:00 PM# Then
Text1 = Format(Now, "Short Date")
End If
End Sub
All the best.
Chris
[This message has been edited by ChrisJackson (edited 01-21-2000).]
-
Ok, thanks.
------------------
Ryan