Results 1 to 5 of 5

Add timestamp after text entry

  1. #1
    JeffG3209 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Location
    Weatherford, Texas
    Posts
    66

    Add timestamp after text entry

    I am trying to add a timestamp after an entry. However, when I use the following code it replaces my entry with a timestamp. I am new to VBA so go easy on me please.
    Code:
    Private Sub ACCOUNT_NOTES_AfterUpdate()
    Me.[ACCOUNT NOTES] = Now()
    End Sub

  2. #2
    ajetrumpet is offline Banned
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,696
    are you wanting to record the time of an update into a table or simply change a textbox value to the actual NOW() value after ACCOUNT NOTES is updated??

    based on your post and code, the code is doing exactly what you're asking. you need to assign NOW() to a different textbox if you want to simply DISPLAY a timestamp.

  3. #3
    JeffG3209 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Location
    Weatherford, Texas
    Posts
    66
    I tried this code and received this error.
    Code:
    Private Sub ACCOUNT_NOTES_AfterUpdate()
    Me.[ACCOUNT DATES] = Now()
    End Sub
    Do I need to declare the form I am working with? I figured that would be enough information to add to the [ACCOUNT DATES] field.
    Attached Thumbnails Attached Thumbnails Error.png  

  4. #4
    ajetrumpet is offline Banned
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,696
    Quote Originally Posted by JeffG3209 View Post
    I tried this code and received this error.
    Code:
    Private Sub ACCOUNT_NOTES_AfterUpdate()
    Me.[ACCOUNT DATES] = Now()
    End Sub
    Do I need to declare the form I am working with? I figured that would be enough information to add to the [ACCOUNT DATES] field.
    more than likely you are getting the error because ACCOUNT DATES is not a field with a date/time data type declared.

  5. #5
    JeffG3209 is offline Advanced Beginner
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2011
    Location
    Weatherford, Texas
    Posts
    66
    Correct. Didn't update the table. Thanks!

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Access Query to Check Timestamp
    By Meh in forum Access
    Replies: 1
    Last Post: 12-21-2010, 05:18 PM
  2. "Internal" timestamp on table rows?
    By quahtrader in forum Access
    Replies: 1
    Last Post: 07-13-2010, 09:43 AM
  3. Replies: 2
    Last Post: 11-11-2008, 11:12 AM
  4. Replies: 0
    Last Post: 11-06-2008, 10:29 AM
  5. Access Timestamp...
    By HMel in forum Access
    Replies: 4
    Last Post: 08-19-2008, 12:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Tech Forums: Microsoft Office Forums