Results 1 to 5 of 5
  1. #1
    dargo72 is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Sep 2012
    Posts
    53

    Keep Time Current

    I currently have a Time() field on my form. Is there an easy way to add a line item to the current event so that it refreshes the time to stay current?

    Thank you,

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726

  3. #3
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    To begin with, Time is a Reserved Word in Access and should never be used as the name of a Field/Control, so you need to change that.

    Here's a thing I use. You'll need a Textbox called txtOmega (yeah, I'm a watch fanatic) and you'll maybe want to add some cosmetics to it, like a frame around it.

    Go to your Form’s property box. Under the Event Tab find Timer Interval and enter 1000.

    Code:
    Private Sub Form_Open(Cancel As Integer)
    'Displays while waiting for timer to crank up    
         Me.txtOmega = Time 
    End Sub
    
    Private Sub Form_Timer()
        Me.txtOmega = Time 'Display time
    End Sub

    Remember to change txtOmega to the actual name of your Textbox.

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  4. #4
    dargo72 is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Sep 2012
    Posts
    53
    Quote Originally Posted by Missinglinq View Post
    To begin with, Time is a Reserved Word in Access and should never be used as the name of a Field/Control, so you need to change that.

    Here's a thing I use. You'll need a Textbox called txtOmega (yeah, I'm a watch fanatic) and you'll maybe want to add some cosmetics to it, like a frame around it.

    Go to your Form’s property box. Under the Event Tab find Timer Interval and enter 1000.

    Code:
    Private Sub Form_Open(Cancel As Integer)
    'Displays while waiting for timer to crank up    
         Me.txtOmega = Time 
    End Sub
    
    Private Sub Form_Timer()
        Me.txtOmega = Time 'Display time
    End Sub

    Remember to change txtOmega to the actual name of your Textbox.

    Linq ;0)>

    Thanks for the info. Actually, the field is NOT called Time, sorry for the confusion.

    However, on the "event" tab, I do not see On Timer......... which is odd. I'm running 2007. Is it located somewhere else?

    Thank you,

  5. #5
    dargo72 is offline Advanced Beginner
    Windows Vista Access 2007
    Join Date
    Sep 2012
    Posts
    53
    Quote Originally Posted by dargo72 View Post
    Thanks for the info. Actually, the field is NOT called Time, sorry for the confusion.

    However, on the "event" tab, I do not see On Timer......... which is odd. I'm running 2007. Is it located somewhere else?

    Thank you,
    Never mind.... found it....

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

Similar Threads

  1. Replies: 1
    Last Post: 08-14-2012, 03:22 AM
  2. Replies: 2
    Last Post: 08-12-2012, 10:56 AM
  3. Show current Time
    By dada in forum Programming
    Replies: 5
    Last Post: 05-03-2012, 04:32 AM
  4. How to show current vacation time
    By Brian62 in forum Forms
    Replies: 1
    Last Post: 06-24-2011, 04:34 PM
  5. VB coding to show current date n time in access form
    By cwwaicw311 in forum Programming
    Replies: 6
    Last Post: 02-10-2010, 09:53 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