Results 1 to 15 of 15
  1. #1
    gint32 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jan 2015
    Location
    Australia
    Posts
    116

    update table.field from excel

    Hi everyone,

    Other than manually updating each, is there a way of updating a specific column in one specific table. I have a list off usernames which is generally last name with first initial ge: smith andy = SmithA, but of course when there are two or more Smith A's, such as Smith Arron and Smith Amanda then the usernames(login names) have to be different, so I have an excel sheet with all of these "Double Ups", but I am trying to figure out a way of running through this list (in excel) and updating the Table in


    Access where it finds a match in the table. So does anyone know of a way to loop through the list, or do I have to do this manually. The excel file has a unique the user id that matches the table.

    Thanks for reading and any input that you may have

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Presuming you can link to the Excel spreadsheet, an update query would be the quickest way to update all the records in the table.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    Create a linked table for your Excel file in Access. Run an update query linking the Excel table to your Access users table
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  4. #4
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,424
    Link to the spreadsheet (like you would a table) in Access and create an Update query where you join the Access table to the spreadsheet with an equal join on the user id.
    BTW, Access tables don't have columns, they have fields. A common question here ought to be why you use Excel in the first place when a table is the only thing you need.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    gint32 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jan 2015
    Location
    Australia
    Posts
    116
    Quote Originally Posted by Micron View Post
    Link to the spreadsheet (like you would a table) in Access and create an Update query where you join the Access table to the spreadsheet with an equal join on the user id.
    BTW, Access tables don't have columns, they have fields. A common question here ought to be why you use Excel in the first place when a table is the only thing you need.
    thanks..re excel this is the way the new data was presented to me!

  6. #6
    gint32 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jan 2015
    Location
    Australia
    Posts
    116

    update query linking to Excel

    Quote Originally Posted by Micron View Post
    Link to the spreadsheet (like you would a table) in Access and create an Update query where you join the Access table to the spreadsheet with an equal join on the user id.
    BTW, Access tables don't have columns, they have fields. A common question here ought to be why you use Excel in the first place when a table is the only thing you need.
    Sorry Everyone, but I am having trouble with this one, could someone be so kind as to provide me with a downloadable example, so as I can adjust to suit my needs.
    I've done the link to excel a
    and the equal join on the IDs, b

    But that's as far as my small mind can get too!

    Thanks

  7. #7
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,424
    could someone be so kind as to provide me with a downloadable example
    Not me - I'm too lazy to create a db and a workbook, interpret your data, populate my workbook and table then join them and create a query for you that's probably all wrong. But you can post a db and a small workbook with data in both files and I/we will see what comes out of it.

  8. #8
    gint32 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jan 2015
    Location
    Australia
    Posts
    116
    Sounds like a big ask .My apologies .I really just need the part I am stuck at. Which is what goes in the update to field. As when I click in this field there is no data to select from...so do i manually type something like..
    Excel.workbook.column.F3.values

  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,652
    Since the Excel file is linked, it's the way you would refer to a table field:

    [FieldName]

    The two tables would need to be joined in the query.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  10. #10
    gint32 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jan 2015
    Location
    Australia
    Posts
    116
    Quote Originally Posted by pbaldy View Post
    Since the Excel file is linked, it's the way you would refer to a table field:

    [FieldName]

    The two tables would need to be joined in the query.
    As I said in post 6, the join are done (with the two table) thanks though

  11. #11
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    Here's a very basic update query for you to adapt
    Code:
    UPDATE tblAccess INNER JOIN tblExcel ON tblAccess.Id = tblExcel.id SET tblAccess.LastName = [tblExcel].[LastName];
    
    Change the table and field names accordingly.
    However if you use the query designer, intellisense will guide you anyway.
    Last edited by isladogs; 04-28-2019 at 10:00 AM.
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  12. #12
    gint32 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jan 2015
    Location
    Australia
    Posts
    116
    Thanks..as always you always come through. When all else fail..👍

  13. #13
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    You're welcome. Not sure what your problem was however.
    Until you feel confident writing SQL, use the query designer to construct what you require.
    If you want to then convert to SQL that's easy to do ... or you could use my SQL to VBA and back again utility to help you ....
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  14. #14
    gint32 is offline Competent Performer
    Windows 7 64bit Access 2013
    Join Date
    Jan 2015
    Location
    Australia
    Posts
    116
    [QUOTE=isladogs;If this has helped, please click the star button and leave a comment....[/QUOTE] wheres the star button

  15. #15
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    Quote Originally Posted by gint32 View Post
    wheres the star button
    Next to the triangle!
    OK, its in the green bar below this at the bottom of each post
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

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

Similar Threads

  1. Replies: 4
    Last Post: 11-27-2014, 10:20 AM
  2. Replies: 17
    Last Post: 10-27-2014, 04:15 AM
  3. Update records on only ONE FIELD from excel data?
    By stildawn in forum Import/Export Data
    Replies: 3
    Last Post: 11-19-2013, 04:55 PM
  4. Importing Excel - Update table field with the worksheet name
    By maggiemago3 in forum Import/Export Data
    Replies: 1
    Last Post: 08-22-2013, 04:51 PM
  5. Replies: 5
    Last Post: 11-01-2012, 09:26 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