From: DontKnow on
Hi Guys,

I need help in showing a timer value in a text box as well the user can
still operate a form within the database, whilst the counter is counting down.

I want ot be able to set a variable timer say to 30 seconds and be able to
update text boxes within a form. I don't know if it is possible to update the
form whilst the timer is runnig??

Does anyone have a pre made timer such as this??

many thansk for your help in advance!!

Cheers,

From: John W. Vinson on
On Mon, 26 Apr 2010 22:31:01 -0700, DontKnow
<DontKnow(a)discussions.microsoft.com> wrote:

>Hi Guys,
>
>I need help in showing a timer value in a text box as well the user can
>still operate a form within the database, whilst the counter is counting down.
>
>I want ot be able to set a variable timer say to 30 seconds and be able to
>update text boxes within a form. I don't know if it is possible to update the
>form whilst the timer is runnig??
>
>Does anyone have a pre made timer such as this??
>
>many thansk for your help in advance!!
>
>Cheers,

A timer is builtin. You can set the form's TimerInterval property to 1000
(milliseconds, one second) and put code in its Timer event to decrement the
value in a textbox. In some appropriate event, set the value of an unbound
textbox txtCountdown to 30 and set TimerInterval to 1000; then in the form's
Timer event put code like

Private Sub Form_Timer()
If Me!txtCountDown > 0 Then
Me!txtCountDown = Me!txtCountDown - 1
Else
<do whatever is appropriate when the sand has run out>
Me.TimerInterval = 0 ' to turn off the timer
End If
End Sub

--

John W. Vinson [MVP]
From: DontKnow on
Thanks again John!!

I was overcomplicating the whole thing!!

Exactly what I was after!!

"John W. Vinson" wrote:

> On Mon, 26 Apr 2010 22:31:01 -0700, DontKnow
> <DontKnow(a)discussions.microsoft.com> wrote:
>
> >Hi Guys,
> >
> >I need help in showing a timer value in a text box as well the user can
> >still operate a form within the database, whilst the counter is counting down.
> >
> >I want ot be able to set a variable timer say to 30 seconds and be able to
> >update text boxes within a form. I don't know if it is possible to update the
> >form whilst the timer is runnig??
> >
> >Does anyone have a pre made timer such as this??
> >
> >many thansk for your help in advance!!
> >
> >Cheers,
>
> A timer is builtin. You can set the form's TimerInterval property to 1000
> (milliseconds, one second) and put code in its Timer event to decrement the
> value in a textbox. In some appropriate event, set the value of an unbound
> textbox txtCountdown to 30 and set TimerInterval to 1000; then in the form's
> Timer event put code like
>
> Private Sub Form_Timer()
> If Me!txtCountDown > 0 Then
> Me!txtCountDown = Me!txtCountDown - 1
> Else
> <do whatever is appropriate when the sand has run out>
> Me.TimerInterval = 0 ' to turn off the timer
> End If
> End Sub
>
> --
>
> John W. Vinson [MVP]
> .
>
From: DontKnow on

Once the timer is completed is it possible to start it again?
"John W. Vinson" wrote:

> On Mon, 26 Apr 2010 22:31:01 -0700, DontKnow
> <DontKnow(a)discussions.microsoft.com> wrote:
>
> >Hi Guys,
> >
> >I need help in showing a timer value in a text box as well the user can
> >still operate a form within the database, whilst the counter is counting down.
> >
> >I want ot be able to set a variable timer say to 30 seconds and be able to
> >update text boxes within a form. I don't know if it is possible to update the
> >form whilst the timer is runnig??
> >
> >Does anyone have a pre made timer such as this??
> >
> >many thansk for your help in advance!!
> >
> >Cheers,
>
> A timer is builtin. You can set the form's TimerInterval property to 1000
> (milliseconds, one second) and put code in its Timer event to decrement the
> value in a textbox. In some appropriate event, set the value of an unbound
> textbox txtCountdown to 30 and set TimerInterval to 1000; then in the form's
> Timer event put code like
>
> Private Sub Form_Timer()
> If Me!txtCountDown > 0 Then
> Me!txtCountDown = Me!txtCountDown - 1
> Else
> <do whatever is appropriate when the sand has run out>
> Me.TimerInterval = 0 ' to turn off the timer
> End If
> End Sub
>
> --
>
> John W. Vinson [MVP]
> .
>
From: BruceM via AccessMonster.com on
You could do something like this in an appropriate event, maybe in a command
button Click event:

Me.txtCountDown = 30
Me.TimerInterval = 1000

DontKnow wrote:
>Once the timer is completed is it possible to start it again?
>
>> >Hi Guys,
>> >
>[quoted text clipped - 25 lines]
>> End If
>> End Sub

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/Forums.aspx/access-formscoding/201004/1