Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AUTOMATIC ENTER TODAYS DATE INTO A FIELD

Status
Not open for further replies.

HerickP

IS-IT--Management
May 10, 2000
68
US
Hi, <br><br><br>I have this form used to enter data into a table. I would like to tag every single record with a date that it was entered, so when u add a record to the table, it will also automatically add the date it was entered to a field in the table called &quot;date entered&quot;. The person entering the data could do that as they entered, but I am wondering if it can be auto done, and specifically, have the date entered in the format &quot;Short date&quot;. Thanks a lot.
 
sure have your &quot;DateEntered&quot; field and put it on the form, with the Format set to Short Date.<br>and in any other field that the user will be changing on that form, put in the after update property (through code builder) the following statement.<br><b><br>Me.DateEntered.Value = Date()<br></b><br><br>sometimes the <b>Date()</b> doesn't work, so use the <b>Now()</b> function instead, or i think <b>Today()</b> works as well.<br><br>this will change the date to the current date everytime the record is updated. <p>Brian Famous<br><a href=mailto:bfamous@ncdoi.net>bfamous@ncdoi.net</a><br><a href= > </a><br>
 
If Date() does not work check your references libraries. Open a module and click Tools, select References and make sure that you have the latest versions of Microsoft DAO 3.6 Library, and Microsoft Office 9.0 Object Library.&nbsp;&nbsp;Click the check boxes next to them and then OK to ensure that you will be referencing the libraries in your code.<br><br>Bob<br>
 
There is another way to do that too, if you set DateEntered Default Value =Date() when you developed the table. So everytime a new form is developed the date would be the current date.
 
I'd recommend that you use Now(), this will give you a time stamp along with the date stamp.<br><br>HTH<br>RDH <p>Ricky Hicks<br><a href=mailto: rdhicks@mindspring.com> rdhicks@mindspring.com</a><br><a href= > </a><br>
 
set the default value of the field on your table to date()<br>whenever a new record is created this date will be updated to the current date or set a text box to the same default and bind it to your table date field(You may want to lock the field in the properties to stop changes)
 
You can enter =now() in the default value parameter in the design view.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top