Link to home
Create AccountLog in
Avatar of Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.Sc
Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.ScFlag for Zambia

asked on

Analog Clock in Ms Access

I have done a digital clock on my switchboard form by using Time() and on timer event plus a re query all is working Okay but I want to turn it into an analog clock , any idea there.

Regards
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Avatar of Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.Sc

ASKER

Because of viruses I would not want a download , my digital clock is already working, I only need the steps or code to fixed it

Regards

Chris
Avatar of Norie
Norie

Chris

Can you post your code for your digital clock?
Okay here is my code:

(1) Create clock control  (txtclock)
(2) txtclock  Format property time to (Long)
(3) txtclock data property ( =Time()
(4) On timer make it 1000
(5) On time event

Private sub .......
Me.txtclock.Requery
End Sub

Regards

Chris
That code doesn't compile ...

Because of viruses I would not want a download


You really should install an antivirus package.
The first and free step would be to active Windows Defender which works very well.

/gustav
ASKER CERTIFIED SOLUTION
Avatar of Norie
Norie

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
For a start you would need code to draw a clock including minute/hour hands, markings for hours etc

Exactly this is what I was looking for, any idea about this same code , example how to create it?

Regards

Chris


[/i]
After search on the net I found this code which appear to what Norie is saying :

Create a new form, minimum size 14cm by 14cm.
Anywhere on the form, place 3 lines of any length called scrLineSecond,
scrLineMinute and scrLineHour.

Set the form's TimerInterval to 1000.

In the OnTimer event, past the following:

Private Sub Form_Timer()
Call calcClockHands("Second", Second(Now()))
Call calcClockHands("Minute", Minute(Now()))
Call calcClockHands("Hour", Hour(Now()))

End Sub

I'm only confused by the statement below:

Anywhere on the form, place 3 lines of any length called scrLineSecond,
scrLineMinute and scrLineHour.

Any idea about these lines where do i get them ?

I just want to understand these lines, the rest of coding using X & Y will be done without problems

Regards

Chris
Simple clock utilizing just VBA (no controls). I was interested with composing a simple clock and the timekeepers accessible through VB all utilized the VB line strategy for drawing. Access is unique! There is a LineSlant property to be set and additionally figuring the begin and end focuses. I put the begin focuses, end focuses and line incline into an exhibit and simply call the directions from the cluster each second. This is as it were the primary go as I need to pass the measurements to the clock for resizing, setting the hues and balances for time zones and so forth and so on.
Chris

If you open a form in Design View, not Layout View for some reason, you'll find there is a Line control you can add to the form.

Perhaps that's what's being referred to in what you found.
Okay I have seen it, it is working , for those who may want to use the analogy clock , my advise is to try the Blue Bridge Pty Ltd, Sydney Australia they have done a good code but you have to acknowledge while incorporating it simply google it . However, the digital way seams to be user friendly

Regards

Chris