Results 1 to 3 of 3
  1. #1
    JoshuaRogers is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    5

    Updating Multiple Tables Via One Form

    Good evening folks.



    I'm working on a database to keep track of wear and tear on parts, and while the majority of it is going great, I'm at a point where my vague recollections of database design courses back in 2005 are failing me. So I'm hoping you can help.

    Right now I have a large number of tables, each of which is dedicated to a particular kind of part (such as calipers, tie rods, and batteries) and uses the serial number of the part as the primary key. These all are linked on a one-to-many relationship to another table that keeps track of dates, chassis, mileage, and which parts were on that chassis on that date (aka, the Events table).

    What I'm trying to do is create a form that will allow someone to enter a record into the Events table, and at the same time, update the mileage totals for all of the parts used at that event.

    So it'd be something along the lines of a button that does this (pardon my pseudocode):

    1. Create record in Events table
    2. Calipers.Mileage = Calipers.Mileage + Form.MileageTextbox where Calipers.Serial = CalipersCombobox
    3. Brakes.Mileage = Brakes.Mileage + Form.MileageTextbox where Brakes.Serial = BrakesCombobox

    And so on.

    I'm fairly certain this can be done, via coding if nothing else. I just don't know the proper way to go about it.

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Not sure I would have separate tables for kinds of parts. Are the fields different in the tables?

    Sounds like you need to run multiple UPDATE queries.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    JoshuaRogers is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    5
    Some are and some aren't; the design's for caution as much as anything else- should someone need to look at the raw data for a particular part type, they can go straight to a table and get it quickly without having to set up a query. Which is important as I'm the only one in the business who has any idea you'd even want to query a database.

    I ended up using lots of UPDATE queries for this, as well as other parts of the database in similar veins (such as resetting current mileage on a part while updating the total mileage after the part is rebuilt, and putting the whole mess into a separate table for recordkeeping).

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

Similar Threads

  1. Multiple tables to create one Form??
    By Gravity101 in forum Forms
    Replies: 2
    Last Post: 06-02-2011, 06:37 AM
  2. Multiple tables in 1 form ?
    By baseborn in forum Forms
    Replies: 5
    Last Post: 12-13-2010, 10:06 AM
  3. Updating 4 Tables From 1 Form
    By kevsim in forum Forms
    Replies: 2
    Last Post: 11-15-2010, 03:08 AM
  4. Updating Multiple Tables
    By gazzieh in forum Queries
    Replies: 0
    Last Post: 03-17-2010, 05:59 AM
  5. Replies: 0
    Last Post: 03-19-2006, 11:52 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