Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

timer datacontrol

Status
Not open for further replies.

vz

MIS
Jul 31, 2001
131
US
does anyone have an example on how to use the timer data control?
thanks in advance
 
Hi,

Not sure what your looking for but here is one example I have....

On a form I created sort of a custom progress bar... So I added a bunch of colorfull bars using the shape control. So I had like Shape(0) to Shape(39) and set the visible property to FALSE.

Then added a TIMER CONTROL to the form. I set the INTERVAL of the timer to 2000. Remember that is in milliseconds...

Next added the code to the time...

Private Sub Timer1_Timer()
For i = 0 To 40
If Shape1(i).Visible = False Then
Shape1(i).Visible = True

Exit Sub

End If

Next
End Sub

The timer begins counting when the form is executed. I think you can reset the counter and start at a different point by setting the counter to a new number. remember that the counter will trigger an event only when it reaches the interval number.

Well anyway, just put that together really fast as an example... I am sure the expert users of this site have other examples...

Hope this helps..

Regards,
MDA
 
Is there a way or is it even possible to use the timer control or some other control to get it to refresh the vb abpplication or at least requery the databases every 5 minutes?
thanks
 
Hey vz...

I am not sure what you mean by refresh a vb application? As for a query, I would think it is possible, sure. You would just want to put your query in the timer event. So every time the timer event fires, your query is re executed.

However, I don't think the timer control counts past about one(1) minute. Check out msdn and search for more info on this.... Here is one link:


Perhaps, others have an idea how to do this here?

Good luck...

MDA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top