Analog Clock in Ms Access

Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.Sc
Hankwembo Christopher,FCCA,FZICA,CIA,MAAT,B.A.Sc used Ask the Experts™
on
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
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
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
NorieAnalyst Assistant

Commented:
Chris

Can you post your code for your digital clock?
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

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
Most Valuable Expert 2015
Distinguished Expert 2018

Commented:
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
Analyst Assistant
Commented:
Chris

To create an analog clock you would need a lot more than that.

For a start you would need code to draw a clock including minute/hour hands, markings for hours etc.
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.
NorieAnalyst Assistant

Commented:
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

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial