Results 1 to 4 of 4
  1. #1
    dcdimon's Avatar
    dcdimon is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2013
    Location
    Bradenton, FL
    Posts
    71

    Force focus away from a tab page on the hour

    I have a tab control with eight pages - 1 for each hour of an eight hour shift - and I'd like to force the focus away from an hour and to another as the clock hour changes. Thus, if you're on hour 2 tab when the clock hour went from 2 to 3 you'd be moved to the hour 3 tab.



    I have this working with a time interval and a set focus event on the form's On Timer event with the interval set at 5 minutes. However, what I'd like to be able to do is set the interval dynamically, depending on when they opened that current hour's tab.

    Something like CurrentTime - Next Whole hour = minutes until next hour. That way I'd only be cycling one per hour and eliminating the screen flash I get now every 15 minutes. It'd also make sure that my setfocus would happen on the hour instead of some time after.

    Any ideas? Has this already been discussed somewhere? If so let me know.

    Thanks,

    DD

  2. #2
    robrich22's Avatar
    robrich22 is offline Advanced Beginner
    Windows 7 64bit Access 2007
    Join Date
    Feb 2013
    Location
    Louisville, KY
    Posts
    41
    Just off the top of my head... Try the minute function. 1 hr = 60 minutes.. So 60 - Minute(Now()) would give you the minutes until the next hour and then set Form.TimerInterval = x mins * 60 seconds * 1000 milliseconds.. Timer Interval works on milli seconds.

  3. #3
    dcdimon's Avatar
    dcdimon is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2013
    Location
    Bradenton, FL
    Posts
    71
    That looks like it'll work.....thanks.

  4. #4
    dcdimon's Avatar
    dcdimon is offline Advanced Beginner
    Windows 7 32bit Access 2010 32bit
    Join Date
    Sep 2013
    Location
    Bradenton, FL
    Posts
    71
    robrich22:

    That worked perfectly. I totally blanked on how to determine the minutes left in the hour - I had been thinking about it for so long that your simply solution totally fell off my radar.

    Thanks!

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

Similar Threads

  1. How to force Page Footer to the bottom of report
    By nightangel73 in forum Reports
    Replies: 1
    Last Post: 06-20-2014, 11:46 AM
  2. Replies: 2
    Last Post: 12-21-2013, 02:09 PM
  3. Replies: 1
    Last Post: 10-20-2013, 10:04 AM
  4. Replies: 3
    Last Post: 11-13-2011, 10:20 PM
  5. Force new page
    By kwooten in forum Reports
    Replies: 1
    Last Post: 07-28-2011, 04:42 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