Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: convert text box to be a clock


Message #1 by wesley.fitzpatrick@s... on Fri, 19 Apr 2002 09:25:23 +0200
Hi,

I'm trying to create a textbox on a form which would act basically as a
clock, the code I have so far is:

Me.txtTime = Now()

If Me.txtTime <> Now() Then
DoCmd.Requery Me.txtTime = Now()
End If

I know it's not complete and that I need to use a loop but im not sure what
else I need to add.

Does anyone have any suggestions?

Thanks,

Wes.
Message #2 by wesley.fitzpatrick@s... on Fri, 19 Apr 2002 10:00:27 +0200
No replies needed- I found out by putting the code:

Me.txtTime = Format(Now())

Behind the On Timer event.

Thanks.

Wes.

 ~ -----Original Message-----
 ~ From: Fitzpatrick Wesley CHDI 
 ~ Sent: Freitag, 19. April 2002 09:25
 ~ To: Access
 ~ Subject: [access] convert text box to be a clock
 ~ 
 ~ 
 ~ Hi,
 ~ 
 ~ I'm trying to create a textbox on a form which would act 
 ~ basically as a
 ~ clock, the code I have so far is:
 ~ 
 ~ Me.txtTime = Now()
 ~ 
 ~ If Me.txtTime <> Now() Then
 ~ DoCmd.Requery Me.txtTime = Now()
 ~ End If
 ~ 
 ~ I know it's not complete and that I need to use a loop but 
 ~ im not sure what
 ~ else I need to add.
 ~ 
 ~ Does anyone have any suggestions?
 ~ 
 ~ Thanks,
 ~ 
 ~ Wes.
 ~ 
 ~ 
Message #3 by "Derrick Flores" <Derrick_Flores@s...> on Fri, 19 Apr 2002 08:05:41 -0500
Wes,
Create a form with only 1 Text Box and then Set the Form Timer Interval to 
1000.  In the Form Timer Event Enter similar code as below.  Once you 
finished your form,
Create a subform (with this form) on the form that you want to see the 
time.

Private Sub Form_Timer()
txtDateTime =3D Now()
End Sub

Thanks,

Derrick Flores
66318

>>> <wesley.fitzpatrick@s...> 04/19 2:25 AM >>>
Hi,

I'm trying to create a textbox on a form which would act basically as a
clock, the code I have so far is:

Me.txtTime =3D Now()

If Me.txtTime <> Now() Then
DoCmd.Requery Me.txtTime =3D Now()
End If

I know it's not complete and that I need to use a loop but im not sure 
what
else I need to add.

Does anyone have any suggestions?

Thanks,

Wes.


Message #4 by John Fejsa <John.Fejsa@h...> on Mon, 22 Apr 2002 08:55:58 +1000
Hi Wesley,

Use OnTimer Event.  Type the following procedure and set TimeInterval to 
1000 (1 second).

Private Sub Form_Timer()
    Me!txtTime =3D Now()
End Sub

You can format the output to various styles by using Format, ie. Me!txtTime
 =3D Format(Now(), "hh:mm:ss AMPM") and so on.


____________________________________________________

John Fejsa
Systems Analyst/Computer Programmer
Hunter Centre for Health Advancement
Locked Bag 10, WALLSEND NSW 2287
Phone: (02) 4924 6336 Fax: (02) 4924 6209
www.hcha.org.au
____________________________________________________

The doors we open and close each day decide the lives we live
____________________________________________________

CONFIDENTIALITY & PRIVILEGE NOTICE
The information contained in this email message is intended for the named 
addressee only.  If you are not the intended recipient you must not copy, 
distribute, take any action reliant on, or disclose any details of the 
information in this email to any other person or organisation.  If you 
have received this email in error please notify us immediately.

>>> wesley.fitzpatrick@s... 19/04/2002 17:25:23 >>>
Hi,

I'm trying to create a textbox on a form which would act basically as a
clock, the code I have so far is:

Me.txtTime =3D Now()

If Me.txtTime <> Now() Then
DoCmd.Requery Me.txtTime =3D Now()
End If

I know it's not complete and that I need to use a loop but im not sure 
what
else I need to add.

Does anyone have any suggestions?

Thanks,

Wes.


This message is intended for the addressee named and may contain confidential information. If you are not the intended recipient,
please delete it and notify the sender. Views expressed in this message are those of the individual sender, and are not necessarily
the views of Hunter Health.

Message #5 by wesley.fitzpatrick@s... on Mon, 22 Apr 2002 08:41:36 +0200
Thanks John and Derrick for your help! it works.

 ~ -----Original Message-----
 ~ From: John Fejsa [mailto:John.Fejsa@h...]
 ~ Sent: Montag, 22. April 2002 00:56
 ~ To: Access
 ~ Subject: [access] Re: convert text box to be a clock
 ~ 
 ~ 
 ~ Hi Wesley,
 ~ 
 ~ Use OnTimer Event.  Type the following procedure and set 
 ~ TimeInterval to 1000 (1 second).
 ~ 
 ~ Private Sub Form_Timer()
 ~     Me!txtTime = Now()
 ~ End Sub
 ~ 
 ~ You can format the output to various styles by using Format, 
 ~ ie. Me!txtTime = Format(Now(), "hh:mm:ss AMPM") and so on.
 ~ 
 ~ 
 ~ ____________________________________________________
 ~ 
 ~ John Fejsa
 ~ Systems Analyst/Computer Programmer
 ~ Hunter Centre for Health Advancement
 ~ Locked Bag 10, WALLSEND NSW 2287
 ~ Phone: (02) 4924 6336 Fax: (02) 4924 6209
 ~ www.hcha.org.au
 ~ ____________________________________________________
 ~ 
 ~ The doors we open and close each day decide the lives we live
 ~ ____________________________________________________
 ~ 
 ~ CONFIDENTIALITY & PRIVILEGE NOTICE
 ~ The information contained in this email message is intended 
 ~ for the named addressee only.  If you are not the intended 
 ~ recipient you must not copy, distribute, take any action 
 ~ reliant on, or disclose any details of the information in 
 ~ this email to any other person or organisation.  If you have 
 ~ received this email in error please notify us immediately.
 ~ 
 ~ >>> wesley.fitzpatrick@s... 19/04/2002 17:25:23 >>>
 ~ Hi,
 ~ 
 ~ I'm trying to create a textbox on a form which would act 
 ~ basically as a
 ~ clock, the code I have so far is:
 ~ 
 ~ Me.txtTime = Now()
 ~ 
 ~ If Me.txtTime <> Now() Then
 ~ DoCmd.Requery Me.txtTime = Now()
 ~ End If
 ~ 
 ~ I know it's not complete and that I need to use a loop but 
 ~ im not sure what
 ~ else I need to add.
 ~ 
 ~ Does anyone have any suggestions?
 ~ 
 ~ Thanks,
 ~ 
 ~ Wes.
 ~ 
 ~ 
 ~ This message is intended for the addressee named and may 
 ~ contain confidential information. If you are not the 
 ~ intended recipient, please delete it and notify the sender. 
 ~ Views expressed in this message are those of the individual 
 ~ sender, and are not necessarily the views of Hunter Health.
 ~ 
 ~ 
 ~ 

  Return to Index