Share via

Access 2010 refresh interval

Anonymous
2011-05-25T19:23:31+00:00

I am using this expression in an Unbound Control on a form to display date and time. =Format(Now(),"dddd"", ""mmmm dd"", ""yyyy"" at ""h:nn:ss AM/PM")

The time (i.e., seconds, minutes) change as I scroll thru records w/mouse wheel or record selector.  Is there a way to set the refresh interval or the Forms Timer interval so the form refreshes automatically every second or more so the time in my expression will change automatically also.  Or do I need to use a timer/clock?  fyi.. In a 2010 version I set the Refresh interval to 1 sec in the Options/Client Settings/Refresh Interval(sec).  I think that is the same as Tools/Options/Advanced in Access 2003.

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

5 answers

Sort by: Most helpful
  1. Anonymous
    2011-05-25T19:58:55+00:00

    Steve

    You have to use a timer event to refresh the form. Actually, just requering the control should do it.

    Set the timer interval to 1000. That would be 1 second. For the Timer event:

    Private Sub Form_Timer()

        Me.MyTextbox.Requery

    End Sub

    Keep in mind short timer intervals can make an application jumpy. And be sure to have that form closed when you are writing code or the refreshing of the code window will drive you crazy.

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2011-06-01T18:52:33+00:00

    Yes - the caption updates and the other text box recalcs correctly on the save button click event.  I think I had more code than I needed to do what I wanted - and therefore was overcomplicating the solution.  Thanks for the follow up reply.

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2011-06-01T17:02:40+00:00

    So you're good to go then, Steve?

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2011-05-27T16:54:33+00:00

    Bill - I put the caption code in the save button click event after the me.recalc - and it works OK.  e.g., the caption is updated after a new or existing record is saved and the other text box with the expression is recalculated.

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2011-05-26T20:03:29+00:00

    Bill - Thanks for your help with the timer Requery code.  I set the timer to 60,000 msec so it requeries on the minute (i.e., every 60 seconds).  You were right about the jumpy/blinking effect using the short intervals.  I was perusing your web site and began researching Caption code after reading your article and applying your code to fill in Captions on forms.  I also found another neat Caption code trick (using the form current event) to dynamically change the caption based on controls on the form. e.g., me.caption = "Emp Info for " & me.Emp_Name.  I also found some code to requery and stay on the same record so it will save a NEW record, change the Caption and stay on the same record.  I put the code in a SAVE Button CLICK event.  It works fine and dandy on one form.  But I have another form that currently uses a ReCalc function in the SAVE record button Click event.  Because on that form I have an Unbound text box with an EXPRESSION so I need to update existing records, save, recalc and stay on the same record.  And for a new record I want to SAVE recalc and/or requery and stay on the same record after it is saved and have the caption change dynamically.  I think the Recalc and Requery code is conflicting or out of Order when combined with the me.newrecord condition.    I can provide more detail or air code if it will help.  Or let me know if I should make a new post since this question is more about requery/recalc than the original post.

    Was this answer helpful?

    0 comments No comments