Inserting The Time & Date

ShaunT

New member
Local time
Today, 12:44
Joined
Apr 10, 2003
Messages
7
Hi,

I have a form upon which I wish to insert the current time and date is that possible?

Thanks in advance.

Shaun
 
Insert a text box whose control source is set to =Date()
 
Use:

=Now()

as Date() will only return the current date, and you asked for time and date
 
Hi

Thanks very much. I didn't realise it was so simple.

One more question, the form now displays the date and time but the time does not increment how do I do this?

Again, many thaks for your help

Shaun
 
Set your form's TimerInterval property to 1000 (1 second in milliseconds)

On your form's OnTimer event, write this bit of code to requery the textbox.

i.e

txtYourTextBox.Requery
 
Hi,

I have set the timer interval and written the code in the On Timer event. When a display the form I get a message saying "Cant Find Macro:- Time" The Macro doesnt exist etc. Which it doesn't. I didn't realise I needed one, or am I just being stupid?

The code I wrote is

B]On Timer[/B] "time.requery"

My text box is called time.

Thanks for your help

Shaun
 
On the OnTimer event, click on the button at far right of the column (it has three dots) - select Code Builder.

You'll be taken to the form's module.

Between the lines written there:

Code:
Private Sub Form_Timer()

End Sub

put the line:

Me.txtYourTextBox.Requery

So, it should look like this:

Code:
Private Sub Form_Timer()
   Me.txt[i]YourTextBox[/i].Requery
End Sub
 
Thanks

Hi,

Yes that's working. You have been a great help.

Thank you very much.

Thanks

Shaun
 

Users who are viewing this thread

Back
Top Bottom