Stopwatch To Countdown
Jul 28, 2006
Is there a way to have this stopwatch to countdown from 10 minutes to 00:00:00:00?
Option Compare Database
Option Explicit
Dim TotalElapsedMilliSec As Long
Dim StartTickCount As Long
Private Declare Function GetTickCount Lib "kernel32" () As Long
Private Sub Form_Timer()
Dim Hours As String
Dim Minutes As String
Dim Seconds As String
Dim MilliSec As String
Dim Msg As String
Dim ElapsedMilliSec As Long
ElapsedMilliSec = (GetTickCount() - StartTickCount) + _
TotalElapsedMilliSec
Hours = Format((ElapsedMilliSec 3600000), "00")
Minutes = Format((ElapsedMilliSec 60000) Mod 60, "00")
Seconds = Format((ElapsedMilliSec 1000) Mod 60, "00")
MilliSec = Format((ElapsedMilliSec Mod 1000) 10, "00")
Me!ElapsedTime = Hours & ":" & Minutes & ":" & Seconds & ":" _
& MilliSec
End Sub
Private Sub btnStartStop_Click()
If Me.TimerInterval = 0 Then
StartTickCount = GetTickCount()
Me.TimerInterval = 15
Me!btnStartStop.Caption = "Stop"
Me!btnReset.Enabled = False
Else
TotalElapsedMilliSec = TotalElapsedMilliSec + _
(GetTickCount() - StartTickCount)
Me.TimerInterval = 0
Me!btnStartStop.Caption = "Start"
Me!btnReset.Enabled = True
End If
End Sub
Private Sub btnReset_Click()
TotalElapsedMilliSec = 0
Me!ElapsedTime = "00:00:00:00"
End Sub
View Replies
Feb 4, 2006
I am creating a databse to help people with course registration. I have a form (Classes) and a sub form (Classes Subform). In the classes subform I have the following fields:
StudentID
Major
PhoneNumber
Grade
On the Classes form I have two fields I am concerened about. Seats and a field called Open Seats. If I set the number of Seats (Seats) to 31, I would like 31 to appear in my open seats field. As I add students to the Classes Subform (New Records) I would like open seats to decrease by one. I've seen this done, but have no idea how.
Once this is figured out, Is it possible for the form to automatically change my Status field from Open to Closed?
View 1 Replies
View Related
Aug 23, 2005
I would like to have a form that simply has 4 or 5 due dates for certain things. I would also like to have a countdown field that takes todays date and all of the due dates and tells me how many days i have until then. Is this possible? And, if so, can anyone help?
View 1 Replies
View Related
Feb 7, 2005
i wonna count down for 20 minits and then autoclose my program. every time there is an activity the counter has to reset. any idea where and how to do it?
thx in advance
killroy
View 3 Replies
View Related
Oct 13, 2004
I have two databases; a server and a client. The server houses all of the tables, while the client has the tables linked and serves primarily as a form for users to enter data to the main table. Periodically I update the form, so I would like to be able to shut down each client while I upload the new files to update the client. Here is my thinking:
I have a table in server.mdb called admin with 3 columns and one record.
The fields are:
closex (text) - This will be populated when I want to send the close countdown command.
message (text) - The string I want to display in a warning popup box.
Timer (integer) - The time in seconds before the program will close.
Right now I have a hidden LIST box in the form (closemsg) that is bound to column 1 and column count=3.
Me.closemsg.column(0) is closex
Me.closemsg.column(1) is message
Me.closemsg.column(2) is timer
The box is requeryed every 2 seconds to check and see if the table has been updated along with another line of code that keeps the time current until someone starts to enter a record.
I have a macro that will perform the close operation. Here is the code I have thus far....any help would be greatly appreciated.
___________________________________________
Private Sub Form_Timer()
'Updates the Time to Current
If (IsNull(Agent)) Then
Me!Call_Time = Time()
End If
'Checks for updated values in Admin Table
Me.closemsg.Requery
' -------------
'| Force Close |
' -------------
'Message Variable from T.Admin
Dim message As String
'Timer Variable from T.Admin
Dim timer As Integer
'Macro Variable to Close App
Dim macroname As String
macroname = "Closeapp"
'Check to see if T.Admin has changed
If (IsNull(Me.closemsg.Column(0))) Then
Else
message = Me.closemsg.Column(1)
timer = Me.closemsg.Column(2)
'Set Timer
timer = timer * 1000
'Notify User
MsgBox message
Count:
timer = timer - 1
If timer > 0 Then
GoTo Count
Else
DoCmd.RunMacro macroname
End If
End If
End Sub
View 5 Replies
View Related
Jun 29, 2007
hey,
Sorry to open with a question but its usually the way, i'm quite an experienced computer user but never used any office products before and just thought i should learn as i'm losing money every week by not keep track of things properly.
So then to my question..
I've made a table to cover all the orders i have had placed, this includes a date column for when that order was placed. I just wondered if it would be possible to have some kind of system where after 7 days without any acknowledgement from me it either pops up or turns red or something similiar. I'm thinking the acknowledgement could be the yes/no box and i tick that when i recieve the item back, if i dont it either pops up or turns red or something :confused:
any help much appreciated
View 2 Replies
View Related
Jul 31, 2012
I have created a countdown counter on a form using different Datediff's so to split the renaining time into days, hours, minutes and seconds.
The Datediff compares Now() to a text box called txt.Leaving which has a date/time unputted via a table (Format: General Date)
However the seconds and minutes work ok but the hours and days dont count down inline with the minutes and seconds reducing. The hours do alter when the minutes are 13 mins into the new hour. This would seem to point possibly to rounding off but I would expect that further into the hour.
Below is the Datediff that is set as the control source in a text box and the form it sits on has its timer set to 1000 and the event requeries the text box.
=DateDiff("d",Now(),[txt.Leaving]) & "d, " & DateDiff("h",Now(),[txt.Leaving]) Mod 24 & "h, " & DateDiff("n",Now(),[txt.Leaving]) Mod 60 & "m, " & DateDiff("s",Now(),[txt.Leaving]) Mod 60 & "s"
Using Access 2000.
View 2 Replies
View Related
Aug 27, 2014
I have access db sending report with outlook every Monday.
But the problem is if outlook is open when I start the db, email goes in to outgoing folder and msg box of outlook opens saying " outlook will close after countdown if I do not hit the "DO NOT EXIT" button or "EXIT AND SEND LATER" button.
If I hit "EXIT AND SEND LATER" button, it sends next time I open the outlook.
Is it possible to prevent outlook doing this?
View 14 Replies
View Related