Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Format Timer
Masih Ostad Novin 
     
2 years ago
Hi. I built a timer countdown from 600 seconds (10 minutes) and now instead of displaying seconds I want to format it so it displays minutes and seconds, like 00:00. How can I do that? See image below.
Thanks
Masih
Masih Ostad Novin OP  @Reply  
     
2 years ago

Juan C Rivera  @Reply  
            
2 years ago
Event Countdown
or
In the VBA editor, for the form insert the following code:

CODE-------------------------------------------------------------------------------------------------------------------------

Private lastActivityTime As Date
Private Const inactivityTimeout As Integer = 10 ' Timeout value in minutes

Private Sub Form_Timer()
    ' Check if the form has had any activity
    If DateDiff("n", lastActivityTime, Now) > inactivityTimeout Then
        ' No activity for the specified timeout, close the database
        DoCmd.Quit acQuitSaveNone
    End If
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    ' Update the last activity time when the form is clicked or the mouse is moved
    lastActivityTime = Now
End Sub

Private Sub Form_Load()
    ' Initialize the last activity time when the form is loaded
    lastActivityTime = Now
    Me.TimerInterval = 60000 * 10 ' Set the timer interval to 10 minutes (60000 milliseconds * 10)
End Sub

CODE END ---------------------------------------------------------------------------------------------------------------------
credit for this goes out to Brent Rinehart .

Hope this helps.

V/r
Juan
Kevin Robertson  @Reply  
          
2 years ago
Set the Timer Interval to 1000.
Add a Text Box for minutes and a Text Box for seconds (add a third for the colon) - use the Default Value property.
Set Shape Fill and Shape Outline to Transparent.
Draw a Rectangle over the Text Boxes and give it a border and backcolor (Send To Back).

Kevin Robertson  @Reply  
          
2 years ago

Masih Ostad Novin OP  @Reply  
     
2 years ago
Thanks Kevin. It works fine.

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/2/2026 8:23:24 AM. PLT: 0s