Results 1 to 12 of 12
  1. #1
    trevor40's Avatar
    trevor40 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    407

    text box shows time frozen intermitantly

    Hi, I have a text box set to display the current time, hh:mm:ss
    this is updated on the timer event for the form every 500ms
    for some reason it will stop ticking over, while the rest of the form and all other actions are working fine.
    Any ideas ?




    Code:
    Private Sub Form_Open(Cancel As Integer)
    DoCmd.Maximize
    Application.CommandBars.ActiveMenuBar.Enabled = False
    Application.RefreshTitleBar
    fActivateControlBox (False)
    Forms![main menu]![barcode] = DLookup("[barcode]", "[Employees]", "[first name] = Forms![main menu]![employees at work]![first name]")
    Forms![main menu]![pass] = DLookup("[password]", "[Employees]", "[first name] = Forms![main menu]![employees at work]![first name]")
    Forms![main menu]![employees at work].Form.Requery
    End Sub
    Private Sub Form_Timer()
    Me.[display time] = Now()
    End Sub

    1000 ways to skin a cat, allways looking for another one...
    Use MDB format for sample post. If your issue is fixed, mark the thread solved.
    Click on the star below if this has helped.

  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,849
    I think you have to set a timerInterval. I don't see that in your code.

    see this M$oft link

  3. #3
    trevor40's Avatar
    trevor40 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    407
    the timer interval is set to 500ms, thats done in the form properties .

    FROM ABOVE !
    Private Sub Form_Timer()
    Me.[display time] = Now()
    End Sub

    1000 ways to skin a cat, allways looking for another one...
    Use MDB format for sample post. If your issue is fixed, mark the thread solved.
    Click on the star below if this has helped.

  4. #4
    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,849
    I just watched this youtube video, then set up a textbox on a form as suggested, and all is well, time is displaying live.

  5. #5
    trevor40's Avatar
    trevor40 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    407
    yep thats what i have done, i do have a lot of other code that navigates away from the main menu to get employee password form, then update employee details form, after this it returns to the main menu. most of the time it's ok, but about 2-3 times a week it will just stop. very intermitant...

    1000 ways to skin a cat, allways looking for another one...
    Use MDB format for sample post. If your issue is fixed, mark the thread solved.
    Click on the star below if this has helped.

  6. #6
    trevor40's Avatar
    trevor40 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    407
    what i'm going to try is to put more code in the timer event and watch and see what it does if the timer does lock up...

    1000 ways to skin a cat, allways looking for another one...
    Use MDB format for sample post. If your issue is fixed, mark the thread solved.
    Click on the star below if this has helped.

  7. #7
    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,849
    Sounds like a plan. Good luck.

    Please post a solution or the conditions causing the freeze -I'm sure others will benefit.

  8. #8
    trevor40's Avatar
    trevor40 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    407
    i have added a simple text box to the form, me.Text1234

    in the timer event i have added

    if me.text1234.backcolor = vbred then
    me.text1234.backcolor = vbblue
    else
    me.text1234.backcolor = vbred
    end if

    now i'll wait to see if that stops changing color when the time stops, and go from there...

    1000 ways to skin a cat, allways looking for another one...
    Use MDB format for sample post. If your issue is fixed, mark the thread solved.
    Click on the star below if this has helped.

  9. #9
    trevor40's Avatar
    trevor40 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    407
    Well, that didn't work. when the clock stoped so did the little colored text box stoped blinking red/blue. but the pc also has crahsed, so i'll first see if that the cause and then come back to the timer event problem.

    1000 ways to skin a cat, allways looking for another one...
    Use MDB format for sample post. If your issue is fixed, mark the thread solved.
    Click on the star below if this has helped.

  10. #10
    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
    Quote Originally Posted by trevor40 View Post

    ...i do have a lot of other code that navigates away from the main menu to get employee password form, then update employee details form, after this it returns to the main menu. most of the time it's ok, but about 2-3 times a week it will just stop...
    That, I suspect, is the culprit, here! Having a timer event set on one Form has long been known to cause erratic behavior when moving between Forms, with 'erratic' being the key word! The behavior can be experienced on the Form holding the time display, as you're seeing, or on other open Forms, with the timer event causing problems in code on the other Forms preventing proper execution.

    I've used this kind of thing for ages, without every seeing this kind of behavior, but I never go roaming between multiple Forms while it is running.

    There's always the possibility that the Textbox Control is corrupted; they can and do become corrupted. The test and fix for this is the same...delete the Control then recreate it.

    The only other thought I have would be to 'goose' the Control by use the Form's OnActivate event to re-assign the value to [display time] Control.

    Linq ;0)>

  11. #11
    trevor40's Avatar
    trevor40 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    407
    well, resetting the timer value to 0 on lost focus and to 500 on got focus didn't work, my next test will be to disable/enable the timer event, i will also put the timer value on screen to see what happens with it.

    If all else fails i will be putting an arrow in place of the timer. it will point to the clock on the wall !

    1000 ways to skin a cat, allways looking for another one...
    Use MDB format for sample post. If your issue is fixed, mark the thread solved.
    Click on the star below if this has helped.

  12. #12
    trevor40's Avatar
    trevor40 is offline Competent Performer
    Windows XP Access 2003
    Join Date
    Feb 2014
    Location
    Australia
    Posts
    407
    we now have an arrow pointing to the wall clock. that works!
    the only thing i didnt try is to set the timer value before closing the other forms and returning to the main menu.
    perhaps another day.

    1000 ways to skin a cat, allways looking for another one...
    Use MDB format for sample post. If your issue is fixed, mark the thread solved.
    Click on the star below if this has helped.

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

Similar Threads

  1. Replies: 1
    Last Post: 09-03-2014, 03:23 PM
  2. Replies: 13
    Last Post: 10-24-2013, 06:11 PM
  3. Lookup field shows ID # and not text
    By kelkan in forum Forms
    Replies: 3
    Last Post: 01-26-2013, 09:19 PM
  4. Text box shows ID field and not the Name
    By jzacharias in forum Access
    Replies: 5
    Last Post: 10-18-2012, 10:24 AM
  5. Replies: 1
    Last Post: 12-20-2011, 03:32 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