update table record from xls using "if"

Posted on 2011-05-06
Medium Priority
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
  • 2

Author Comment

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

Accepted Solution

peter57r earned 2000 total points
ID: 35711539
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

ID: 35720365
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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Suggested Courses

840 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