Time Stamp

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to put a button on a form and use it to populate a
text field with the system time. I used the following
code but I keep getting a null value returned:

myTime = time()

Any idea on what the code is to return the time? This
keeps returning a null.
 
Any idea on what the code is to return the time? This
keeps returning a null.

Whenever you are changing from one data type to another, it is wise to use
an explict cast: this is especially true when dealing with dates and times.

It is also a good idea to make very sure that you have told Access whether
you are referring to a data field or a text box:

Me.Controls("MyTime").Value = Format(Now(), "hh:mm:ss")

should do the trick.

Hope that helps


Tim F
 
Back
Top