Results 1 to 2 of 2
  1. #1
    vickan240sx is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    May 2012
    Posts
    34

    VBA code to update field in table

    Hi,



    I am currently trying to add a last updated field for each field on my table. I figure I would have to add a before update code for each field on my form. However, the field that I want to have updated is not located on my form, but just on the table. I would like to have the field on the table updated with the last user and time the field was updated.

    Any help will be greatly appreciated.

  2. #2
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    As long as the table field is included in the recordsource for the form, you can update it without needing a control on the form.

    [TableFieldName] = somevalue works fine, but you will need VBA to do it, and either the Before_Update or After_Update event is a good place.
    Just be sure you don't accidently have a form control name the same as one of the table field names.

    John

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

Similar Threads

  1. Replies: 12
    Last Post: 03-17-2012, 04:46 AM
  2. Replies: 12
    Last Post: 03-14-2012, 10:54 AM
  3. Replies: 1
    Last Post: 08-31-2011, 04:03 PM
  4. Update field in table after update on a subform
    By jpkeller55 in forum Queries
    Replies: 3
    Last Post: 09-30-2010, 08:02 PM
  5. Replies: 3
    Last Post: 04-14-2010, 10:07 AM

Posting Permissions

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