|
-
Feb 28th, 2005, 02:56 PM
#1
Thread Starter
Addicted Member
Refreshing at specified time[RESOLVED]
On my form, I have a provision for users to call a subroutine by clicking on a button (lets say "ABC").
So, every time the user clicks ABC, the subroutines kicks off, returns the data onto the form in a listview box.
Now, I want to add functionality for an autorefresh...So, I want to add a command button with a textbox asking the user if he wants to autorefresh the app every ___x___ seconds. The subroutine shud be called every x amount of seconds that the user enters (after the command button is clicked).
I believe I can use timer for this functionality...but, Im struggling to add an event into the timer sub, and I have not been able to find the correct solution in the archives.
Any help will be appreciated!!
Last edited by perlmonk; Feb 28th, 2005 at 04:14 PM.
-
Feb 28th, 2005, 03:00 PM
#2
Re: Refreshing at specified time
Add an event in the timer sub? Can't you just use the Timer event, and set the interval to what ever is written in your text box?
ØØ
-
Feb 28th, 2005, 03:06 PM
#3
Thread Starter
Addicted Member
Re: Refreshing at specified time
 Originally Posted by NoteMe
Add an event in the timer sub? Can't you just use the Timer event, and set the interval to what ever is written in your text box?
ØØ
i guess I am wondering wht a timer event is?
will the timer subroutine get called every time when the timer interval is up?
VB Code:
Private Sub Timer1_Timer()
'lets say "refresh.text holds the value of the refresh time
timer1.interval = refresh.text
call sub_abc()
End Sub
is that the right way to go about it?
-
Feb 28th, 2005, 03:10 PM
#4
Re: Refreshing at specified time
 Originally Posted by perlmonk
i guess I am wondering wht a timer event is?
will the timer subroutine get called every time when the timer interval is up?
VB Code:
Private Sub Timer1_Timer()
'lets say "refresh.text holds the value of the refresh time
timer1.interval = refresh.text
call sub_abc()
End Sub
is that the right way to go about it?
Yeah that is the way. But I would have taken out the
timer1.interval = refresh.text
line, and added it to a command buttons click event or something. And remember that the timers Interval property is milli seconds. So 1000 is 1 second.
ØØ
-
Feb 28th, 2005, 04:14 PM
#5
Thread Starter
Addicted Member
Re: Refreshing at specified time
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|