Results 1 to 2 of 2
  1. #1
    mavisyew is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Aug 2014
    Posts
    34

    Use VBA to update another table

    Hi All,

    I have created a form with a field status for the table named, tblHistory.


    I will like to update another table, tblCaseDetail, Status field when i click Save in the form.

    What is the code i should write to update to the tblCaseDetail's status field in the private sub AfterUpdate?

    Thanks in advance.

  2. #2
    mavisyew is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Aug 2014
    Posts
    34
    Hi All,

    I did it.

    I add in the below code to my afterupdate


    DoCmd.RunSQL "UPDATE TBLCaseDetail" & _
    " SET TBLCaseDetail.Status = """ & Me.Status & _
    """ WHERE TBLCaseDetail.CaseID = """ & Forms![FormCaseHistory]![CaseID] & """"

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

Similar Threads

  1. Replies: 1
    Last Post: 05-17-2013, 12:53 PM
  2. Replies: 7
    Last Post: 09-21-2012, 11:09 AM
  3. Replies: 1
    Last Post: 02-08-2012, 04:50 PM
  4. Replies: 1
    Last Post: 01-22-2011, 12:23 PM
  5. Update field in table after update on a subform
    By jpkeller55 in forum Queries
    Replies: 3
    Last Post: 09-30-2010, 08:02 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
  •  
Other Forums: Microsoft Office Forums