473,385 Members | 1,474 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Having a clock displayed on a Form

36
i am trying to create a clock with the date that i could display on a form? can someone help me design a basic one? any help would be appreciated
Apr 16 '07 #1
4 12855
ADezii
8,834 Expert 8TB
i am trying to create a clock with the date that i could display on a form? can someone help me design a basic one? any help would be appreciated
For a Date and Digital Clock display on your Form:
  1. Place a Lablel Control on your Form and name it lblClock.
  2. Set the appropriate Properties such as Font, Font Size, Bold, Text Alignment, etc. for the Label.
  3. Set the Form's Timer Interval to 1000 (1 second)
  4. Place the code listed below in the On Timer() Event of the Form
  5. The Clock will update itself every second - see sample output below
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Timer()
  2.   'There are many variations on the Date/Time display Format
  3.   'this is just one of them
  4.   Me![lblClock].Caption = Format$(Now(), "dddd, mmm dd, yyyy - hh:mm:ss AM/PM")
  5. End Sub
Output:
Expand|Select|Wrap|Line Numbers
  1. Sunday, Apr 15, 2007 - 09:17:39 PM
Apr 16 '07 #2
atiq
36
For a Date and Digital Clock display on your Form:
  1. Place a Lablel Control on your Form and name it lblClock.
  2. Set the appropriate Properties such as Font, Font Size, Bold, Text Alignment, etc. for the Label.
  3. Set the Form's Timer Interval to 1000 (1 second)
  4. Place the code listed below in the On Timer() Event of the Form
  5. The Clock will update itself every second - see sample output below
Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Timer()
  2.   'There are many variations on the Date/Time display Format
  3.   'this is just one of them
  4.   Me![lblClock].Caption = Format$(Now(), "dddd, mmm dd, yyyy - hh:mm:ss AM/PM")
  5. End Sub
Output:
Expand|Select|Wrap|Line Numbers
  1. Sunday, Apr 15, 2007 - 09:17:39 PM
I followed these steps but when i tested the form it when into VB window and highlighted the Format$ while displaying the following error message:

Compile error:

Can't find project or library


any ideas how i can fix this?
Apr 16 '07 #3
yeah....I tested myself.

Its working fine. But, Why it is blinking..?

Any alternation need to be done..?

Thnx..

ngr..
Apr 16 '07 #4
pks00
280 Expert 100+
Hi Atiq

the problem you say, u may have reference problems. In the vba window of Access, go to Tools/References. Are there any listed as missing?

Some alternatives to the digital clock (solution already provided)

How about a progressive clock?
http://www.functionx.com/vbaccess/articles/progressclock.htm

Or maybe even an analogue clock
http://www.thescripts.com/forum/thread487187.html


solargovind, I suggest you open a new question if you want to get answers
refer to this question
Apr 16 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: ratlhead | last post by:
Hey all, I've provided a form for a client of the company I work for that basically emails the form data to an email address. Only a couple of the many fields are required...nothing too fancy....
19
by: Raposa Velha | last post by:
Hello to all! Does any of you want to comment the approach I implement for instantiating a form? A description and an example follow. Cheers, RV jmclopesAThotmail.com replace the AT with the...
0
by: Maileen | last post by:
Hi, I have a MDI form which should display (within itself) 2 other SDI forms. On the left part of my MDI, i have a treeview control which allows me to select and display the SDI form required. ...
2
by: JDW | last post by:
How can I set an analogue clock in a Form ? JDW Belgium Europe.
6
by: jan | last post by:
My apologies for being a javascript beginner and asking such a basic question. This is probably so easy that nobody ever mentions it. Tutorials and places that tell of basic commands never seem to...
4
by: Paul | last post by:
Hi all, I have a page with a mutli view control where one of the views needs to contain a separate HTML get form with a submit button that goes to another page. In ASP this was no problem -...
3
by: dtvuser | last post by:
Hi, I'm new to PHP and seem to be having soom problems, I'm getting confused with all the different styles of script writing. I've created a PHP script to submit details to my email but the...
5
by: tbeers | last post by:
Good morning. Is there a way to put a clock on a form? I know you can add a unbound box with default set to now() which gives you a date stamp when the form opens. How do put a clock on a from...
6
by: shapper | last post by:
Hello, I am creating a form that includes a few JQuery scripts and TinyMCE Editor: http://www.27lamps.com/Beta/Form/Form.html I am having a few problems with my CSS: 1. Restyling the Select
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.