By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,030 Members | 2,277 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,030 IT Pros & Developers. It's quick & easy.

date/time stamp

P: n/a
I have a textbox on my form label date/time. I also added a date/time
column to my table as well. The table already contains records before
the date/time column was added. How do I setup a date/time stamp to
that textbox or column for any changes that is made to any records?
I've added =Now() on the AfterUpdate properties of the text box, but it
is only adding a stamp if new records are added not when there are just
changes made. Please help. Thanks.

Mar 9 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
<fo*******@martecgroup.com> wrote in message
news:11**********************@j33g2000cwa.googlegr oups.com...
I have a textbox on my form label date/time. I also added a date/time
column to my table as well. The table already contains records before
the date/time column was added. How do I setup a date/time stamp to
that textbox or column for any changes that is made to any records?
I've added =Now() on the AfterUpdate properties of the text box, but it
is only adding a stamp if new records are added not when there are just
changes made. Please help. Thanks.


In the "before update" event of the form:

Me.txtMyTextBox = Now()

HTH - Keith.
www.keithwilby.com
Mar 9 '06 #2

P: n/a
When I add that in the before update I get a "you can't go to a
specified record" box that pops up. Only option is to click "ok" and
it goes back to the same form with the same record. I do have a save
record button on the form where it asks the user if they want to save
the record and move onto the next or cancel. If that helps clear things
a bit. Thanks.

Mar 9 '06 #3

P: n/a
Keith's advice is correct. Remove what you entered in the textbox's
AfterUpdate. Set the textbox's Locked property to Yes or Visible property to
No to prevent the user from manually editing this time. Set the
ControlSource of the textbox to the field you want to store the date/time
in. Make sure you add this field to the query that is supplying the data to
the form's RecordSource.

Once you do all of this and adjust the name of the textbox in the code that
Keith gave you to match the name of your textbox, it should work. Place the
statement after any statements that you may have in the form's BeforeUpdate
event that would Cancel the update (if any).

--
Wayne Morgan
MS Access MVP
<fo*******@martecgroup.com> wrote in message
news:11**********************@i40g2000cwc.googlegr oups.com...
When I add that in the before update I get a "you can't go to a
specified record" box that pops up. Only option is to click "ok" and
it goes back to the same form with the same record. I do have a save
record button on the form where it asks the user if they want to save
the record and move onto the next or cancel. If that helps clear things
a bit. Thanks.

Mar 9 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.