Results 1 to 5 of 5
  1. #1
    kstyles is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2010
    Posts
    24

    update query

    Okay - I've got my update query to work with the following sql:

    UPDATE [Annual Review Table] INNER JOIN [Loan Table] ON ([Annual Review Table].Borrower = [Loan Table].Borrower) AND ([Annual Review Table].Borrower = [Loan Table].Borrower) SET [Loan Table].[Relationship Manager] = [Annual Review Table].[Relationship Manager], [Loan Table].Branch = [Annual Review Table].[Branch], [Loan Table].Borrower = [Annual Review Table].[Borrower]


    WHERE ((([Loan Table].[Annual Review Number])=[Annual Review Table].[Annual Review Number]));


    It updates all the records I HAD in my table - but it's not updating the new records I have entered.... Each time I run it it says I'm updating 38 rows - which was my pre-existing data. I have added 6 more rows that need updating. Is there something I'm missing so that I can update everything?

  2. #2
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    based on my guessing (only guessing because not enough information to make sure), you should join on [Annual Review Number] instead of [Borrower]:

    UPDATE [Annual Review Table] INNER JOIN [Loan Table] ON [Loan Table].[Annual Review Number])=[Annual Review Table].[Annual Review Number] SET [Loan Table].[Relationship Manager] = [Annual Review Table].[Relationship Manager], [Loan Table].Branch = [Annual Review Table].[Branch], [Loan Table].Borrower = [Annual Review Table].[Borrower]

  3. #3
    kstyles is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2010
    Posts
    24
    I input the new records in a subform. When I input them it is just a loan number and a dollar amount, and an annual review number. Then when I am done I want to run a query to update the blank portions of their specific table - a borrower, a relationship manager, and a branch.

    The new records only have a loan number, loan amount, and an annual review number. This is the same way I had all the other records before I ran the update query.

    The corresponding table that it's supposed to update from has everything in it - ie the borrower, relationship manager, branch...

  4. #4
    weekend00 is offline I may not be right
    Windows XP Access 2003
    Join Date
    Aug 2010
    Posts
    1,295
    I've edited my post, did you notice that?

  5. #5
    kstyles is offline Novice
    Windows XP Access 2007
    Join Date
    Dec 2010
    Posts
    24
    Thank you for your help. It makes more sense now! I was way off there. Anyway - here's my final SQL if anyone every needs a reference:

    UPDATE [Annual Review Table] INNER JOIN [Loan Table] ON ([Annual Review Table].[Annual Review Number]=[Loan Table].[Annual Review Number]) SET [Loan Table].[Relationship Manager] = [Annual Review Table].[Relationship Manager], [Loan Table].Branch = [Annual Review Table].[Branch], [Loan Table].Borrower = [Annual Review Table].[Borrower]
    WHERE ((([Loan Table].[Annual Review Number])=[Annual Review Table].[Annual Review Number]));

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

Similar Threads

  1. How can I update a query using VBA?
    By thestappa in forum Programming
    Replies: 2
    Last Post: 06-28-2010, 04:01 PM
  2. Update Query
    By vvasudev in forum Queries
    Replies: 0
    Last Post: 11-10-2009, 01:32 AM
  3. Update Query- selective update?
    By stephenaa5 in forum Queries
    Replies: 1
    Last Post: 10-29-2009, 11:15 AM
  4. Help with update query
    By weirdg in forum Queries
    Replies: 0
    Last Post: 09-03-2009, 04:21 AM
  5. Update Query
    By GrnISSO in forum Queries
    Replies: 0
    Last Post: 06-15-2007, 05:41 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