PDA

View Full Version : Timers?



Coolmo
2004-12-15, 06:52 PM
I've worked in both VB and VBA and was wondering why there's not a timer control available in VBA (that I can find). Is it not allowed because obviously there would be things going on simultaneously? I personally can see the need for one when I have forms up modeless.

Ed Jobe
2004-12-15, 07:03 PM
While there is no timer "control", there is a timer "function". I suppose you could say the the Microsoft Forms 2.0 olb that comes with vba is a stripped down version of vb. There's lots of stuff it doesn't have. But there are workarounds too.

Coolmo
2004-12-15, 07:53 PM
How do you implement and use the timer function?

Ed Jobe
2004-12-15, 08:34 PM
The timer function returns a time value, which you then use to compare to another time value. There is an example in Help. Also, if you use Office, their forms have a timer property that can raise events.

Coolmo
2004-12-16, 01:56 PM
That's pretty cool. I guess you use a While loop to keep checking for a time interval but I can only assume that while this is taking place, AutoCAD is pretty much locked up (i.e. can't keep working in AutoCAD at the same time).

Ed Jobe
2004-12-16, 04:20 PM
You could probably find a free timer control on the web. CCRP (http://ccrp.mvps.org/) is still up. There's a timer on the downloads page.