Results 1 to 8 of 8

Thread: Help Needed!

  1. #1
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2

    Unhappy Unanswered: Help Needed!

    Hi Guys and Gals,

    New to access and i have a form that will be used most of the day at work.

    I have entered a time and date field on the form header, this is ok, but

    i want the time to continuously change i.e every second.

    at present it is static and will only change when i refresh.

    So how do i do this?

    thanks for your help

    steve

  2. #2
    Join Date
    Aug 2002
    Location
    Melbourne, Australia
    Posts
    111
    Have a look at the sample database, I also have one with an analog clock (which is not mine I found it on the web) that you can have if you want. Just send me a PM
    Attached Files Attached Files
    Regards,



    John A

  3. #3
    Join Date
    Dec 2004
    Location
    UK
    Posts
    2

    Talking

    Thanks John

    Exactly what i was after!


    Merry Xmas

  4. #4
    Join Date
    Nov 2003
    Location
    Moorpark, CA
    Posts
    104

    Question Need help

    Hi -

    I've always wanted to learn how to do the continuing time change as well. But unfortunately, everything I know about Access I've taught myself or learned from these forums. Please clarify for me how to incorporate the clock in to my pre-existing db. Thanks! =)

  5. #5
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    I always used the timer event and manually updated a label or textbox with =now
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  6. #6
    Join Date
    Aug 2002
    Location
    Melbourne, Australia
    Posts
    111
    Do you want to use it in an existing form? if so do the following;

    Open your form in design view, open the toolbox and add a new label (Aa) to the form.
    Open the properties of the new label, click ALL and then in the "Name" type lblClock. Now select Format and make the height .2" and the width 3.0".

    Close the Properties dialog box, with the label still selected make changes to background and text colour to suit your needs.

    The next thing is to add the code to the form, you should still have the form opened in design view, so open the properties dialog box again (Alt+Enter).

    Select Event then go to On Open , to the right you will see ... click them and choose Code Builder you will see;

    Private Sub Form_Open(Cancel As Integer)



    End Sub

    Type Me.TimerInterval = 1000

    It should now look like this:


    Private Sub Form_Open(Cancel As Integer)

    Me.TimerInterval = 1000

    End Sub

    Close and return to the form.

    Next (the properties box should still be open now scroll down till you find On Timer, click the ... and then code builder, now type the following into the procedure:

    Me!lblClock.Caption = Format(Now, "dddd, mmmm d yyyy, hh:mm:ss AMPM")

    Close this will return you to your form, close the form saving the changes and then open your form and the "Clock" will appear.


    The sample that I posted has all this (code etc) in it just open the form in design view and check the code (Alt+Enter)
    Regards,



    John A

  7. #7
    Join Date
    Nov 2003
    Location
    Moorpark, CA
    Posts
    104

    Talking

    Thank you sooo much! I had to do a little finagling because my version of access apparently doesn't have ON Open. I didn't even think of checking the code. It works great now!

  8. #8
    Join Date
    Aug 2002
    Location
    Melbourne, Australia
    Posts
    111
    What version of Access do you have?

    I will stand corrected, however I think that all versions of access have the On Open event.


    Have a look at the attached screen dumps (ms Word)


    Glad that you liked it.
    Attached Files Attached Files
    Regards,



    John A

Posting Permissions

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