From: Robert G Robert on 24 Apr 2010 15:51 I would like to create a form that has at least 5 timers on it to count down the time from when a start button is pressed, counting down from 60, 10, 5, 3, and 2 minutes. There needs to be a reset button, with the times reset for each. What would be the code for this?
From: John W. Vinson on 24 Apr 2010 16:08 On Sat, 24 Apr 2010 12:51:01 -0700, Robert G <Robert G(a)discussions.microsoft.com> wrote: >I would like to create a form that has at least 5 timers on it to count down >the time from when a start button is pressed, counting down from 60, 10, 5, >3, and 2 minutes. There needs to be a reset button, with the times reset for >each. What would be the code for this? Well, you'ld use the form's Timer property to count down by seconds or minutes as you prefer, updating five textboxes. It's not clear whether these are all independent, or each have their own start and stop buttons, or how you want the timer to look. More details please! -- John W. Vinson [MVP]
From: Afrosheen via AccessMonster.com on 24 Apr 2010 20:02 Don't know if this will work, but I set up a timer that counts down the number of seconds. Maybe you can modify the code. This code allows the usage of the program time. 140 Const BEGIN_TIME = #4:30:00 AM# 150 Const END_TIME = #8:45:00 PM# 160 If Time < BEGIN_TIME Or Time > END_TIME Then 170 DoCmd.OpenForm "frmTimer" 180 End If Then I created a form with this code: '----------------------------------------------------------------------------- ---------- ' Procedure : Form_Open '----------------------------------------------------------------------------- ---------- ' Private Sub Form_Open(Cancel As Integer) 10 Me.txtTimer.Value = 30 End Sub '----------------------------------------------------------------------------- ---------- ' Procedure : Form_Timer '----------------------------------------------------------------------------- ---------- ' Private Sub Form_Timer() 10 Me.txtTimer.Value = Me.txtTimer.Value - 1 20 If Me.txtTimer.Value = 0 Then 30 DoCmd.Quit 40 Else 50 End If End Sub The txtTimer is an unbound text box set at 30 seconds I hope this helps. John W. Vinson wrote: >>I would like to create a form that has at least 5 timers on it to count down >>the time from when a start button is pressed, counting down from 60, 10, 5, >>3, and 2 minutes. There needs to be a reset button, with the times reset for >>each. What would be the code for this? > >Well, you'ld use the form's Timer property to count down by seconds or minutes >as you prefer, updating five textboxes. It's not clear whether these are all >independent, or each have their own start and stop buttons, or how you want >the timer to look. More details please! -- Message posted via http://www.accessmonster.com
From: Arvin Meyer [MVP] on 25 Apr 2010 17:41 Here's the reverse of what you want. It's a stopwatch. The relevant code can easily be reversed to count down instead of up: http://www.datastrat.com/Download/StopWatch2K.zip Since it probably wouldn't make sense to have all 5 timers counting at once, you could use and option group, combo box, or list box to feed the time. If you did want all five at once, you should open a form with a message at each milepost in your timeline. Access does not have Timer controls, but it does have the Timer property and event in a single form, so you can also use 5 forms. -- Arvin Meyer, MCP, MVP http://www.datastrat.com http://www.accessmvp.com http://www.mvps.org/access "Robert G" <Robert G(a)discussions.microsoft.com> wrote in message news:B4924407-910E-48F2-8FA1-47D2EECF97AE(a)microsoft.com... >I would like to create a form that has at least 5 timers on it to count >down > the time from when a start button is pressed, counting down from 60, 10, > 5, > 3, and 2 minutes. There needs to be a reset button, with the times reset > for > each. What would be the code for this?
|
Pages: 1 Prev: Enabling a control based on multiple criteria Next: Legends |