Results 1 to 8 of 8
  1. #1
    UT227 is offline Expert
    Windows 7 32bit Access 2013 32bit
    Join Date
    Feb 2016
    Posts
    581

    Updating multiple records in a table

    I'm not sure where to start on this. I have 2 tables [tblSchDaily] and [tblSchLeaveDates]. I need to use the field in [tblSchLeaveDates] - [WorkLeaveID] and change the fields in [tblSchDaily] - [WorkLeaveID]. I've done simple update queries, but I can't seem to figure out how to go about this one. These are my two tables. I'd like a point in the right direction.


    Click image for larger version. 

Name:	Tables.jpg 
Views:	21 
Size:	99.4 KB 
ID:	39625

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,816
    Never mind, I did not carefully read question.
    Last edited by June7; 09-01-2019 at 11:22 AM.
    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
    orange's Avatar
    orange is offline Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    I agree with June -- we need to know what you are trying to achieve in simple English. Can only offer focused advice after we understand the requirement.

  4. #4
    accesstos's Avatar
    accesstos is offline Expert
    Windows XP Access 2007
    Join Date
    Dec 2018
    Location
    Greece
    Posts
    551
    Give a try to this:
    Code:
    UPDATE tblSchDaily INNER JOIN tblSchLeaveDates 
    ON tblSchLeaveDates.DailyID = tblSchDaily.DailyID 
    SET tblSchDaily.WorkLeaveID = tblSchLeaveDates.WorkLeaveID;

  5. #5
    UT227 is offline Expert
    Windows 7 32bit Access 2013 32bit
    Join Date
    Feb 2016
    Posts
    581
    [tblSchDaily] is related to [tblSchLeaveDates] with the primary/foreign key [DailyID]. I need to put the field [WorkLeaveID] from [tblSchLeaveDates] into the same field in [tblSchDaily] to update that information.

  6. #6
    UT227 is offline Expert
    Windows 7 32bit Access 2013 32bit
    Join Date
    Feb 2016
    Posts
    581
    Accesstos, I will try that code as soon as my fried brain wakes up. I have been working 20 hour days for bit. I need coffee.

  7. #7
    UT227 is offline Expert
    Windows 7 32bit Access 2013 32bit
    Join Date
    Feb 2016
    Posts
    581
    Accesstos. That worked great. I could have sworn I tried that, but guess I didn't. Thank you.

  8. #8
    accesstos's Avatar
    accesstos is offline Expert
    Windows XP Access 2007
    Join Date
    Dec 2018
    Location
    Greece
    Posts
    551
    You're welcome UT227!

    Your brain has a good friend: Morpheus.
    Don't keep away one from the other.

    Cheers,
    John

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

Similar Threads

  1. Updating Multiple Records
    By wizzz_wizzz in forum Access
    Replies: 1
    Last Post: 01-13-2017, 03:45 AM
  2. Updating Multiple Records at Once Using a Form?
    By CaffeinatedOfficeWorker in forum Forms
    Replies: 5
    Last Post: 07-22-2012, 11:39 AM
  3. Replies: 5
    Last Post: 03-01-2012, 01:11 PM
  4. Updating multiple records
    By Meg in forum Access
    Replies: 1
    Last Post: 01-09-2012, 11:12 AM
  5. Replies: 1
    Last Post: 03-22-2007, 10:19 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