Results 1 to 4 of 4
  1. #1
    5 Star Lounger
    Join Date
    Oct 2001
    Location
    San Bernardino, California, USA
    Posts
    734
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Update Query for multiple tables? (97+)

    Is it possible to use a single update query to update several tables at the same time? I have multiple tables with dates in text format. I created a new DATE field in each table and I want to use an update query to populate the new DATE fields (one per table) with the DATEVALUE([oldtextdatefield]).

    Is this possible or will I cause a bigger problem?

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Update Query for multiple tables? (97+)

    In theory, it is possible to update multiple tables in one update query. It can be useful if there is a relationship between the tables, and if the updates in one table are dependent on values in another table.

    From your description I gather that the updates in each of your table are independent of other tables, so it makes more sense to use a separate update query for each table.

  3. #3
    5 Star Lounger
    Join Date
    Oct 2001
    Location
    San Bernardino, California, USA
    Posts
    734
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Update Query for multiple tables? (97+)

    Thank you, I also think it is prudent to just use individual queries.

  4. #4
    5 Star Lounger
    Join Date
    Nov 2004
    Location
    Wilmington, North Carolina, USA
    Posts
    1,196
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Update Query for multiple tables? (97+)

    Don,
    What I've used successfully in the past in lieu of numerous update queries is a command button with a few lines of DoCmd.RunSQL "...insert sql string here..", they run in order, and I don't have to do anything manually. Use the query wizard to build your queries, then view the SQL. If you need to break the SQL for aesthetic or length purposes, make sure you end your SQL line with " & _ and begin with another ", example:

    "Select ....." & _
    "From...." & _
    "Where...."
    ____________________________
    Jeremy
    "If you spend more on coffee than on IT security, then you will be hacked. What's more, you deserve to be hacked." -Richard Clarke

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •