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

Date stamp

Status
Not open for further replies.

TheEnigma

Technical User
May 26, 2002
69
US
I would like to have an option in my database so that when I tick a tick box, it is stamping a date/time against that field.

The reason I need this is for is when someone enters data into a form, it has a date against that data set. When the information is updated I would like the new date time to appear in another field. This way I can run a query and find out the difference between the 2 times. The view for the person updating the information is in datasheet view though, and shows all outstanding records, so I can't simply set up a seperate field in another form for records that are completed.
 
Why don't you just create another field in your table (sysDate), with a default value of Now()

This way, whenever a user creates a new record, that field will tell you exactly when. You can then use this field in queries or reports or whatever else you need. Jim Lunde
compugeeks@hotmail.com
We all agree your theory is crazy, but is it crazy enough?
 
I don't think this would work because with the datasheet view (when all of the information is being reviewing then actioned) it shows multiple records. As a record is actioned it is then ticked off, then the person doing this moves down to the next line, actions that one then ticks that one off etc etc...

Or is there a way to do it even this way?
 
Due this on the afterupdate or on click event of your tick; put this code in it:

Me.YourDateTimeField.Value = Now()

That's all.

:)WB
 
Thanks wabeg. I think I am missing something though. I pasted the code that you gave me in to the expression "on click" in that tick field on the form, and it comes up with an error when I try to click on the field.

When it comes to code though I have very limited experience, so perhaps I am still doing something wrong!?
 
The only thing I can think of is make sure you replace my YourDateTimeField with what your field name is actually called.

Also what is the error you are getting?

:)WB
 
Ahh.... I see what I have done wrong. The field was a yes/no field. I needed to change the field to date/time. Now I have done that it works fine! :)

Thanks heaps for that, it has been a HUGE help.
 
Actually I have one more small problem... :) When I click on that tick field now, it won't let me untick it if I make a mistake. So if I make a mistake I am stuck with that.

Any ideas?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top