Results 1 to 2 of 2
  1. #1
    masoud_sedighy is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Dec 2011
    Posts
    78

    How to characterize the import Action

    In my database, lists are generally revised several times In order to update the database when a new revision is issued, all the imported data should be provided with a Revision Number and a Revision Type. The Revision Number is the last one for the current data. The Revision Type is a letter to characterize the import Action.

    Code:
    CREATION OF A NEW ELEMENT                    C
    DELETION OF AN EXISTING ELEMENT            D
    MODIFICATION OF AN EXISTING ELEMENT     M
    List of import file fields in excel is like below:

    1- Revision Number (numeric)

    2- Revision Type (text) ---"C" OR "M" OR "D"---

    3- Item Number (text,PK)

    4- Old Item Number (text) -- Only when Item Number has been modified—



    5- Item Name (text)

    6- Item Type Code (text)

    Now I like to import this excel file to my table in Access database but I have problems:

    1- How I have to design my table in access, I must have the same fields of excel file also in access table

    2- How I have to manage these actions , for example some row in my excel file is for creating by "C" character, some rows are for modification of item number with "M" character and also some rows are for deleting item number by "D"

    Please help what is the solution, I like to browse this excel file and then pressing import button on my form and data imported according to Revision Type

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,771
    You have to run 3 SQL actions:

    INSERT

    UPDATE

    DELETE

    Easiest approach is to set a link to Excel sheet and treat the link just like a table. Use the link as the source for the 3 SQL actions. Assumes the Excel sheet structure is compatible for a link.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. botton action
    By tal in forum Access
    Replies: 1
    Last Post: 01-21-2013, 10:11 PM
  2. Undo one action only
    By zoooza84 in forum Access
    Replies: 5
    Last Post: 08-21-2011, 03:04 PM
  3. Can't run this action???
    By wwg77 in forum Programming
    Replies: 2
    Last Post: 02-02-2011, 03:22 PM
  4. Macro Action
    By Bakar in forum Forms
    Replies: 1
    Last Post: 01-05-2011, 12:38 PM
  5. PrintOut action
    By svcghost in forum Programming
    Replies: 11
    Last Post: 10-05-2010, 05:13 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