Make form show at certain time?
Hi there, Does anybody know of a way to make a form show if it is a certain time ?
For example if my computers clock his 17:30 then form2.show?
I basically want it so that a user puts the time they want in text1.text and then when they press the command button then it will wait for the time they enterd and then form 2 will show!
Thanks,
Re: Make form show at certain time?
Add a timer to your form and set its interval for something like 10-20 secs.
In the timer's event, check the system time to see if: Time => TimeSerial(17,30,0).
If so, disable the timer and show the form.
Edited: You'd probably keep the timer disabled by default. When the button is clicked and you validated the user input is a valid time, then you'd enable the timer.
Re: Make form show at certain time?
put this in the timer and just set it to the time you want the second form to show up
Code:
Private Sub Timer1_Timer()
Label1.Caption = Time
If Label1.Caption = "12:35:00 PM" Then
Form2.Show
Timer1.Enabled = False
End If
End Sub
Re: Make form show at certain time?
Thankyou!
I have gone with
Code:
Label3.Caption = Time
If Label3.Caption = "07:06:01" Then
Form2.Show
Timer1.Enabled = False
End If
But how can i make it so the time the form pops up will be what the user puts in.
I Have 3 comboBox and one called hour (which has 1 - 24) Minutes (0 - 59) and seconds.
How can i make it like
if label3.caption ="" the hour a user selects , the seconds the user selects and the minutes?
Thanks
Re: Make form show at certain time?
If time = timeserial(combohour.text, combomin.text, combosec.text) Then
but if the timer misses the exact second in the seconds combo the event won't fire, you would need your timer interval to be under ½ second if you want to be that accurate, or use if time >