Results 1 to 2 of 2
  1. #1
    chin1383 is offline Novice
    Windows XP Access 2003
    Join Date
    Mar 2011
    Posts
    1

    Save record to 2 tables on one click

    Hello Experts,

    How should I save the record in 2 different tables on one button click? Here is what I am trying to do:

    I have 2 tables Customer and Orders

    Customer-à CID CNAME CNUM
    Orders----à OID ONAME CID CNAME



    I have designed a form using ‘Customer’ table and created a ‘Save’ button. Now if I enter the fields CID CNAME from customer form and click on save button, the same values (CID CNAME) should get updated in Orders table as well.

    Any suggestions are greatly appreciated.

    Regards,
    Chinmay

  2. #2
    kennejd is offline Competent Performer
    Windows XP Access 2007
    Join Date
    Mar 2011
    Posts
    188
    These tables should be related by a customerId (foreign field in the orders table). That way if you make a change to the customer table, you don't have to change anything in the orders table. You shouldn't store the customer name in the orders table unless it's something you want for historical puposes...to store the name of the customer at the time of the order.

    If you still think it's important to update the customer name in the orders table, you could create an update query and run it with your save button.

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

Similar Threads

  1. Replies: 9
    Last Post: 12-18-2010, 12:51 PM
  2. Duplicate Record Cannot Save
    By magicscreen in forum Programming
    Replies: 2
    Last Post: 09-15-2010, 08:15 AM
  3. Replies: 1
    Last Post: 05-31-2010, 05:18 PM
  4. VB coding for saving when click on save button in form
    By cwwaicw311 in forum Programming
    Replies: 1
    Last Post: 02-04-2010, 11:11 PM
  5. Click a record to display it for edit
    By mapl in forum Access
    Replies: 0
    Last Post: 11-24-2008, 03: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