Results 1 to 5 of 5
  1. #1
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496

    Time() and adding an hour in front or behind

    I have an unbound text box on a form



    The form timer interval is 1000

    the form property on timer has this in vba

    [txtTime] = Time()

    and it refreshes nicely.

    How do I get it to move one hour forward or behind?

    I was thinking something like Time("h", 3,) but I get errors...

  2. #2
    sdel_nevo is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Apr 2013
    Location
    Gloucester, UK
    Posts
    402
    Hi Ruegen

    try this
    =DateAdd("h", 3,[txtTime])

    Steve

  3. #3
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Quote Originally Posted by sdel_nevo View Post
    Hi Ruegen

    try this
    =DateAdd("h", 3,[txtTime])

    Steve
    It didn't work however..

    I added a second unbound textbox and gave it that and it works on the second one obviously......still...

    My problem is I want several clocks depending on the state the record is so many if statements are needed in the vba..

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    This what you want:

    [txtTime] = DateAdd("h",3,Time())
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496
    Works thanks

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

Similar Threads

  1. Query for Specific 24 hour time period
    By esh112288 in forum Queries
    Replies: 1
    Last Post: 10-23-2012, 02:16 PM
  2. Replies: 1
    Last Post: 06-14-2012, 01:07 PM
  3. Time minus one for hour.
    By brianb in forum Queries
    Replies: 2
    Last Post: 03-09-2011, 11:02 AM
  4. Round up time half an hour
    By JBM18 in forum Queries
    Replies: 2
    Last Post: 12-09-2010, 11:56 AM
  5. [Access 2003] Displaying 24 Hour Time
    By Trainman in forum Access
    Replies: 4
    Last Post: 03-18-2009, 06:34 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