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

    Reset Combo Box to Default Value After One Hour


    How Can I Reset my Combo Box to my Defaut Value After One Hour?

    *And in accomplishing this task is there anyway to keep the Form's TimerInterval = 1000 so that I can incorporate a clock? <= Aesthetic Request*

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    The Great Land
    Related thread

    Apply the same code technique described in the final post of that thread.
    How to attach file: To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Anchorage, Alaska, USA
    Interesting question. But now I have a question: If I start at 8:15 AM, do you want to reset the control at 9:15AM (after 1 hour) or at 9:00AM (on the hour)?

    If you want "on the hour", I found some code on the forum on 10-02-2008 by missinglinq that will work.

    Create an unbound text box and name it txtOmega
    If you don't want to display the seconds (10:15 AM) set the format to "Medium Time"

    Add this code to the form:
    Private Sub Form_Open(Cancel As Integer)
       'Author missinglinq 10-02-2008,
       'Displays while waiting for timer to crank up
       Me.txtOmega = Time
    End Sub
    Private Sub Form_Timer()
       'Author missinglinq 10-02-2008,
       Me.txtOmega = Time   'Display time
       If Minute(Me.txtOmega) = 0 And Second(Me.txtOmega) = 0 Then
          Me.YourCBO = 0
       End If
    End Sub
    Change YourCBO to your control name.

    Set the form's TimerInterval to 1000

    If you want to have buttons to start and stop the timer, add two buttons called cmdClockStart and cmdClockEnd and attach respective code to each to have the clock run on demand.
    '***************** Code Start ***************
    Private Sub cmdClockStart_Click()
    Me.TimerInterval = 1000
    End Sub

    Private Sub cmdClockEnd_Click()
    Me.TimerInterval = 0
    End Sub
    '***************** Code End ***************
    "Veni, Vidi, Velcro"
    (I came; I saw; I stuck around.)

  4. #4
    athyeh is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Jun 2013
    Thread Solved. Thank you.

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

Similar Threads

  1. Replies: 2
    Last Post: 05-05-2013, 09:07 PM
  2. Default Value in Combo Box Not Visible
    By alansidman in forum Forms
    Replies: 5
    Last Post: 04-19-2013, 01:06 PM
  3. Refresh default value for combo box
    By dmunsch in forum Programming
    Replies: 14
    Last Post: 03-18-2013, 12:35 PM
  4. Default value for cascading combo box
    By wwjd80 in forum Forms
    Replies: 1
    Last Post: 06-28-2010, 05:57 PM
  5. Default Value for Cascading Combo Box
    By P5C768 in forum Forms
    Replies: 3
    Last Post: 05-06-2010, 03:50 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 - Senior Forums