Results 1 to 9 of 9
  1. #1
    Join Date
    Jul 2004
    Location
    Inverurie
    Posts
    628

    Unanswered: Clock on a Form.

    Can anyone suggest a method that i can add a digital clock onto a form so that it shows the system time in the following format:

    13:36 JAN 05 (HH:MM MMM YY)

    Thanks in advance for any help!

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Use the timer Interval of the form, adjust it to 1000, then use the OnTimer event to actulize the time in a text box

  3. #3
    Join Date
    Aug 2002
    Location
    Northampton, England
    Posts
    266
    Use this code.

    Function ChangeCaption()

    Dim i As Integer

    For i = 0 To Forms.Count - 1

    Forms(i).Caption = Format(Now, "dddd,mmm d yyyy,hh:mm:ss AMPM")


    Next i


    Call the function from the forms timer event. Set the timer interval to 1000

  4. #4
    Join Date
    Jul 2004
    Location
    Inverurie
    Posts
    628
    Thanks for the input. DJN, i used your one, but when i run the code i get the following error :

    "Can't find project or library"

    And it highlights the Format element of the code.

    Any ideas how to fix this?

  5. #5
    Join Date
    Aug 2002
    Location
    Northampton, England
    Posts
    266
    Sounds like a reference problem. Check that there are no references missing. Go to Modules > Tools > References. I think it is the reference to Microsoft DAO 3.6 Object Library that needs to be checked.

  6. #6
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    The only thing I hate about VB timers is that they're interruptable ... VBA even more so ... Be prepared for this "clock" to have pauses and skips in time.
    Back to Access ... ADO is not the way to go for speed ...

  7. #7
    Join Date
    Aug 2002
    Location
    Northampton, England
    Posts
    266
    I have the DB open all day and can't honestly say I have noticed any problem like that.

  8. #8
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by DJN
    I have the DB open all day and can't honestly say I have noticed any problem like that.
    This will only happen if you have some "intensive" (re: lengthy operations) ... If you don't then the clock will run fine ...
    Back to Access ... ADO is not the way to go for speed ...

  9. #9
    Join Date
    Nov 2013
    Posts
    1

    Access 2010 Display day, date, time

    I have an Access 2010 application on a Vista/32-bit PC.

    I'm also getting the error message "Can't find library or project".
    The word 'Format' is hi-lighted too.

    Private Sub Form_Timer()
    Me!lblClock.Caption = Format(Now, "dddd, mmm d yyyy, hh:mm:ss AMPM")
    End Sub

    I went to Modules>Tools>References and checked the box for "Microsoft DAO 3.6 object library"
    but I got this error message:
    "Name conflicts with an existing module, project, or object library"

    Can anyone suggest something else that may help?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •