VB if statement based on minutes of the hour

Soldato
Joined
25 Jul 2006
Posts
3,529
Location
Taunton
need to write an if statement that will run a routine when it gets to a certain minute every hour, surely this is possible i just cant figure it :confused:

what i got:
Code:
If Minutes = 43 Then
Check1.Value = 1
Form1.Show
mnuTrayDoStuff.Checked = True
End If

but that doesnt work, the timer is set to count in intervals of 60000 (1 minute)

any help?
 
Ladforce said:
does this show the form ever? I also dont understand what you mean about the timer....is it used to run this if statement every minute to check if its the right minute? or do you mean the timer counts up and when its at 43 mins it should trigger? If you could post a bit more of your code I may be able to help more.
sorry i should have been clearer. its runs once every 60 seconds to check what minute of the hour it is and when its 43 minutes past the hour it runs the code and it shows the form when its 43 minutes past the hour.

noob said:
and thats not what im looking for thats a counter. what i want is something that can look at the system clock and when it recognises that the minutes is at 43 it then runs a routine.
 
Last edited:
i love you!

Code:
Minute(Now)
works lovely, and i wouldnt worry too much, its a stupid little project to remind me to do something at 55 past the hour, its nothing special.

and the thing is that it only checks once a minute, and if it doesnt match then it doesnt run the routine.
 
Last edited:
Back
Top Bottom