Results 1 to 3 of 3
  1. #1
    Mclaren is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2010
    Location
    Johannesburg
    Posts
    164

    VBA to update Products Table from excel file

    Hello all,

    Each day we receive a report (MM.xlsx), listing all products available from our manufacturer. The file often has some new products, some amended product descriptions and some products have been deleted from the file compared to previous files. The list is very long, approximately 13000 products.
    I would like to be able to update my products table based on any changes in the new file using a form with an update button.

    When clicking the button I would like the following to take place:


    • ask user to select an excel file to compare current products with those in the excel file.
    • using code, insert any new products to my table
    • mark any products in my table as not available (uncheck the OnMM field in the products table), if the product is no longer on the manufacturers list (Not deleting from my table)
    • Make changes to the product description if any changes exist.




    I have attached example files with examples of each of the above points.

    I must add the excel file is generated from SAP so should never change.

    Any help or pointer in the right direction will be appreciated.
    Attached Files Attached Files

  2. #2
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Hi -

    One question - do you produce client orders and invoices based on what is in the products table? If so, does the order part of your database contain links to the products table?

    In other words - Suppose a client today orders Widget X , with description Y. Then your supplier changes the description of Widget X, to Description Z, so you update the products table.

    Then next week the boss wants to know what that Client ordered - what description of Widget X does the boss get?

    Just a thought.

    John

  3. #3
    Mclaren is offline Competent Performer
    Windows 7 32bit Access 2010 32bit
    Join Date
    Feb 2010
    Location
    Johannesburg
    Posts
    164
    Hello John,

    No, not in this database. the database is used for recording transactions outside of SAP, it used more for tracking stats etc...

    Normilasation is not required on product description or on many of the other fields in the excel file. Annother example of one of the other fields in the excel file is manufacturing plant, this may change based on business requirements. (i must add, the Manufacturer is alsa part of our company)

    So if Widget X is made in plant A and then later is moved to be manufactured in plant B, I lookup the value of the Plant and record that in other tables as required thus keeping both old and new values in other tables.

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

Similar Threads

  1. Importing excel file to append a table
    By vickan240sx in forum Access
    Replies: 1
    Last Post: 06-27-2012, 02:46 PM
  2. Replies: 8
    Last Post: 04-24-2012, 01:05 PM
  3. How to update table if linked ot text file
    By cory_jackson in forum Import/Export Data
    Replies: 7
    Last Post: 01-03-2012, 03:19 PM
  4. update team against 2nd level products
    By Lata in forum Queries
    Replies: 2
    Last Post: 09-20-2011, 03:35 AM
  5. Adapting Excel File to Access Table
    By mbake085 in forum Access
    Replies: 2
    Last Post: 05-18-2011, 10:41 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