How do I get =Now() into the field as records???

J

Joe M

Hi, I am trying to create a field in a table that automatically gets the
current system time when the record is enter. I have code =Now() on the
form, but it wouldn't save into the Field of the table. How do I get it to
save into the field???
 
G

Graham Mandeno

Hi Joe

Bind the table field to a textbox on your form (the textbox does not have to
be visible). Then set the DefaultValue property of the textbox to =Now().
 
J

John Vinson

Hi, I am trying to create a field in a table that automatically gets the
current system time when the record is enter. I have code =Now() on the
form, but it wouldn't save into the Field of the table. How do I get it to
save into the field???

If you set the control source of a textbox to =Now(), it will just
*display* the value, not store it.

Instead, set the control source of the textbox to the name of the
field where you want the time stored, and set its Default property to
Now(). The field will be loaded with the current time at the moment
you first "dirty" the record by entering data into some other field.

John W. Vinson[MVP]
(no longer chatting for now)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top