update table record from xls using "if"

Posted on 2011-05-06
Last Modified: 2012-06-27
Hi Team,

I have an XLS sheet that i have been using to key in data (using copy/paste to get the repeatitive info in quickly) that I use in the warehouse.  the xls has all the same columns that my table has.

what I need to do is a simple "find", then "update" using a command button on a form.

in particular I want to find "file1.serial_#"  in table1.serial_#, and then update table1.box_id with file1.box_id

or in english, have the button go record by record finding a match for the data in column J in the datatable column then update the "new" box id number in the table with what is in the xls column
Question by:KollBrian

    Author Comment

    apologies, the serial number is in column K in the sample1 excel file.
    LVL 77

    Accepted Solution

    Create a link to the Excel file.
    Then you can create a simple update query.  Use your own table and link table names in the following...

    Update tablename inner join  xllinkname
    on tablename.[serial_#] = xllinkname.[serial_#]
    Set tablename.box_id = xllinkname.box_id

    Author Closing Comment

    Thanks Peter, with your help I was able to get the update working perfectly.  Took a bit of research on the syntax but now that I have it this will make my life much easier :)
    Update tbl_box_detail inner join  tbl_test_link on tbl_box_detail.[serial_#]=tbl_test_link.[serial_#]
    SET tbl_Box_Detail.Box_ID=tbl_test_link.box_id, tbl_Box_Detail.PALLET_ID=tbl_test_link.pallet_id  
    Where tbl_box_detail.[serial_#]=tbl_test_link.[serial_#]

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
    Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
    Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
    In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now