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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Dates

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi!
I`m building a DB in access 2000 and I need to have in the table ,enter date & update date, and I want it to be filled automateclly by the system, is there an option in the access to do that, or I have to build a module in VBA?
 
Y.S.

The enter date is a lot easier to accomplish, in the EntryDate field in the table, set it's 'Default Value' property to 'Date()' - this will fill in any new record with the current system date once it's been entered.

As for the auto update field, this one's a little tricky, like the EntryDate, define the default value to Date(). Tables don't support vba, so you should use a form to do this. You will have to write a very simple event to accomplish this.

Just open the main forms properties, click on the events tab. Find an option called 'After Update' and hit the little '...' button beside it. You're going to build an 'Event Procedure'.

Now, all you have to do, when it opens the vba window, is type:
Code:
Me![NameOfDateField] = Date()

Subsitute 'NameOfDateField' to whatever you named the field in the table.

*note - you can change the 'Date()' to 'Now()' if you want them to display the date & the time.

HTH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top