display present date and realtime time on form on opening

xena_morph

Registered User.
Local time
Today, 12:34
Joined
Jul 8, 2000
Messages
37
hi

im wanting to go from form a to form b with form b showing both the time and date as well as options to go to other forms,


- so basivcally how do i get just the time and date to show up

please help
 
just figured if i do a text box with the default value Date() i getthe date - but how the time, i may just do a seperate text box with Time()- just checked it does work


thansk
anyway

-is there anyway of deleting a posting when sent
 
problem is of course that the info is not current just the time and date the form was entered hhmmmmm
 
How about Now() which will show the date and time together
 
this works but the time doesnt change it stays the same as when the form was first opened and i really need it to be in realtime, any ideas?
 
You'll have to requery your text box where your time resides.

To do this, you have to place a an Event Procedure (ie. code)in the "On Timer" property of your form.

Your code should be:

Me.timer.requery
(assuming your text box's name is "timer")

You also have to set the interval property of your form to something like 1000 (this represents 1 second interval, I believe). The higher the number, the slower the change in the time display would be.

edtab
 
ive done the coding and changed the interval to 1000 but it still doesnt work.

i had to put the coding on the 'on change' event as i couldnt see the 'on timer' event
 
aha ive just found the ontimer event and put the coding in with the interval of 1000 but it dont work!
 
On each form that you want to have the date/time show up, put this code into the OnTimer event of that form (set the timer interval to 1000):

Me.Caption = Now()

Each time the timer fires (every 1 second - 1000 milliseconds) the time will change. I use it frequently. Don't "requery" anything. Use the above stuff and it will work.


BL
hth


Oops, I forgot to tell you that you can use it like this as well:

For all of these examples put the code in the form's OnTimer event with interval set at 1000.

To display in a text box:
Me.txtMyTextBoxName.Value = Now()

To display with a label:
Me.lblMyLabelName.Caption = Now()




[This message has been edited by boblarson (edited 04-03-2002).]
 

Users who are viewing this thread

Back
Top Bottom