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

Adding date direct to field 1

Status
Not open for further replies.

SpankYou

Programmer
Feb 24, 2003
211
GB
Okie dokie here I go,

I have a form linked to one table, pretty simple stuff. Now what i want to do is to add a last edited date to the record. I have a last edited field in my database, And a textbox for which to view it. The textbox is locked and disabled, and so I don't want to have to unlock and enable the text box in order to put the date and time into the text box, and then have to lock and disable the text box again. This method would work, but I was wondering if there was a more direct route, for example...

CurrentDatabase.CurrentTable.LastEditedField = Date & Time

Is this possible at all? It seems like such a simple thing but not sure how to do it,

Any help would be great!

Thanks in advance

Cheers

Sam

"You couldn't fool your mother on the foolingest day of your life if you had an electrified fooling machine." - Homer
 
Hey Jim,

Thanks for that link it was very useful not only did I get the code I wanted but I have been wondering about an Audit Trail idea for another project, a star to you good man and some well deserved thanks!

Cheers

Sam

"You couldn't fool your mother on the foolingest day of your life if you had an electrified fooling machine." - Homer
 
Sam

Thanks for the star, but I didn't do anything. Now I'll earn it.

Create a LastEdited field in your table and add that field to your edit form. Set the properties as follows:

[tt]VISIBLE - NO
ENABLED - YES
LOCKED - NO
DEFAULT VALUE - NOW()[/tt]

That'll capture the LAST date/time edited. No history, however. Hope this helps.


Jim DeGeorge [wavey]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top