|
-
Jan 21st, 2000, 03:16 AM
#1
Thread Starter
Hyperactive Member
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
-
Jan 21st, 2000, 03:19 AM
#2
Why don't you just verify the Date before closing/resetting the Form?
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
-
Jan 21st, 2000, 03:24 AM
#3
Lively Member
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).]
-
Jan 21st, 2000, 03:58 AM
#4
Thread Starter
Hyperactive Member
Ok, thanks.
------------------
Ryan
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
|