Results 1 to 3 of 3
  1. #1
    athyeh is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2013
    Posts
    170

    Multiple Timer Events

    Hi Folks,

    Quick question: My form currently has its timer set to 1000, and I have a neat little clock running off of that:



    Code:
    Private Sub Form_Timer()
        Me!Clock.Caption = Format(Now, "dddd, mmm d yyyy, hh:mm:ss AMPM")
    End Sub
    I was wondering, is there a way to incorporate a pop-up message that appears every hour while still having the clock?

  2. #2
    Dal Jeanis is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    May 2013
    Location
    Dallas TX
    Posts
    1,742
    Each form has a single timer.

    You can, however, do multiple things when the timer goes off. You can have a persistent variable that stores other information, and do your popup when hat other variable says to do so.
    Code:
    Private Sub Form_Timer()
    Static LastPopup As Date
    Static NextPopup As Date
       Me!Clock.Caption = Format(Now, "dddd, mmm d yyyy, hh:mm:ss AMPM")
       If NextPopup <= LastPopup Then 
          LastPopup = Now()
          NextPopup = DateAdd("h",1,Lastpopup)
          'athyeh - put your popup code here
       End If
    End Sub

  3. #3
    athyeh is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2013
    Posts
    170
    Perfect. Thanks again Dal. You're awesome.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 05-23-2013, 05:30 PM
  2. Need help with multiple OnTimer events
    By jax1000rr in forum Programming
    Replies: 5
    Last Post: 03-20-2013, 01:58 PM
  3. Replies: 8
    Last Post: 05-25-2012, 11:49 AM
  4. Multiple events for a individual
    By nevets in forum Database Design
    Replies: 2
    Last Post: 02-18-2012, 12:54 PM
  5. Multiple events per location Distance tables
    By flebber in forum Database Design
    Replies: 1
    Last Post: 03-13-2010, 08:48 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums