Monday, May 14, 2018

How to add a real-time clock to your Access forms in Rehema School Prefects Electoral System.

Forms are the interface between your system and the user. For this reason you'd want them to look as good as possible. You also want items on them well arranged. One of the best additions to an Access form is a clock. With a clock on your form, the user does not have to look at his/her watch or the computer's clock.

You have probably noticed that whenever you add a clock to your form, it only updates when you open the form and stays frozen until you close and open the form again. This is really inconveniencing since the clock turns into just but an aesthetic addition, a mere beautification. In this blog post you will learn how to circumvent this.
In your form’s design view, go to date and time and click on ok. Time and date will be shown on your form.
A real-time clock on my Store Management form
Open your form in design view and go to property sheet > event > timer interval. Set the timer interval to 1000.
You now need to edit the on-timer event using Visual Basic. Click on the three dots beside on timer event, pick code builder and paste this code.

Private Sub Form_Timer()
Me.Auto_Time.Requery
End Sub
Save and close. Your clock is now updating in real time. This has to be done on every form that you want to put a clock.