Results 1 to 7 of 7
  1. #1
    Douglasrac is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    92

    Question Importing Excel to Access > Objective: Update records

    Hi,



    I would like to every month, update and add records in my database using excel. But I don't know how I will tell Access which record should be updated, because when I use the key it says it cannot overwrite the key. But its not to overwrite the key, its just to recognize which line should be updated.

    So I have, for example, 2 forms and 2 tables.

    Table 1/Form 1:

    N of Client (key) Name
    1 Douglas

    Table 2/Form 2:

    N of Record (Key) N of Client (just load from previous from to link this ke to table 1 key) Product name Date of Start Date of End Situation State
    1 1 Insurance 01/Set/2014 01/Set/2015 New Valid (actually a check box marked)


    What happens is that in 01/Set/2015 I want to update this record to: Situation (Renewed) and Uncheck the checkbox.

    And then create a new record that will have the exact same things except the date will be different (01/Set/2015 to 01/Set/2016), Situation is renewed and the checkbox is marked. And of course the new key will be 2, but access should generate the key.

    So the problem is how I setup my excel sheet in a way that Access knows it had to update record with key (N of Record) instead of adding a new record? Or instead of thinking that I want to add a key (which is forbidden - in my tables keys can only be added automatically).

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,602
    Why do you want to use Excel?

    You are wanting to generate a custom unique identifier. This is common topic. Search forum. Here is one: https://www.accessforums.net/access/...ers-21361.html

    Having to edit an existing record because of entry of another record is poor design. You know the policy is renewed because there is a later record. No need to save that into the earlier record.
    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.

  3. #3
    Douglasrac is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    92
    I want to use excel because I don't know any other way.

    I need to register the "renew" because later record can mean another product. So just because there is another record (valid or not) it doesn't mean the current one is renew. It can have several active records.

  4. #4
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,602
    Then I don't understand what you are doing. Data entry/edit into Access tables is easily accomplished with forms bound to the tables.

    Also not understanding the data structure.
    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.

  5. #5
    Douglasrac is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    92
    What I'm trying to do is add data by importing because that would be faster then manually input every single data by forms.

    Perhaps I can create a form that will have a tabular shape and add data directly there.

  6. #6
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,602
    How does the data get into the Excel to begin with?

    Forms can certainly be designed to look like a table.
    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.

  7. #7
    Douglasrac is offline Advanced Beginner
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    92
    The data will get into excel by manual input and data generated by the database. So yes, a form looking like a table would help more.

    But you know what would really help? Me inputting the data when its generated, instead of letting it accumulate

    I give up this project, thanks anyway.

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

Similar Threads

  1. Link to Excel; number of records change and Excel can't update
    By crobaseball in forum Import/Export Data
    Replies: 5
    Last Post: 03-22-2014, 11:40 PM
  2. 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
  3. Replies: 5
    Last Post: 03-13-2013, 02:11 PM
  4. Replies: 10
    Last Post: 12-28-2012, 02:06 PM
  5. Importing Excel into Access
    By Nel1975 in forum Access
    Replies: 3
    Last Post: 12-30-2009, 10:21 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