I'm trying to create a program that will only let the user do a certain amount of tasks per 24 hours. The program is very basic and looks kinda like this:
VB Code:
Dim DailyLog As Integer Dim i As Integer Private Sub Timer1_Timer() If i >= DailyLog Then Label5.Caption = "Done with your daily limit!" Exit Sub End If 'Code for sending message i = i + 1 Timer1.Enabled = False Timer2.Enabled = True End Sub
Now, when you look at this, you might think that the i = i + 1 wont work, but I"ve left out a lot of code...in my program it does work.
Here's my question:
If the user closes out the program and starts it again, the program will say that i = 0, but what I want it to do is retain its last value. That value should then reset after 24 hours. Can this be done with the date function.




Reply With Quote