+ Reply to Thread
Results 1 to 2 of 2

Reading From Excel/CSV File to an Access DB

  1. #1
    Registered User
    Join Date
    11-19-2018
    Location
    USA
    MS-Off Ver
    2010
    Posts
    22

    Reading From Excel/CSV File to an Access DB

    I created an upload button for reading in Excel files into tables in Access. I keep on getting an error(Run time error 3022) , please assist.
    Sample data:
    Please Login or Register  to view this content.
    Code:
    Please Login or Register  to view this content.
    Last edited by 6StringJazzer; 03-19-2025 at 10:31 PM. Reason: Moved from Excel Programming / VBA / Macros

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS 365 Family 64-bit 2502
    Posts
    26,916

    Re: Reading From Excel/CSV File to an Access DB

    That error is an Access error so you probably should be posting there instead of Excel.

    When asking about a VBA runtime error always tell us which line of code raises the error.

    "Run-time error '3022': The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again."

    The error tells you pretty much what the problem is. Are you starting with an empty table? If not, what are you starting with? What is the primary key? What is the index? Is there just one table in your model?
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Reading Excel workbook with two worksheet from access - help to use genric names
    By mls_newbee in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-14-2018, 03:06 PM
  2. [SOLVED] Reading data stored in Access without importing it to Excel?
    By Ksun23 in forum Access Tables & Databases
    Replies: 3
    Last Post: 10-12-2017, 01:43 PM
  3. [SOLVED] reading txt file and copying the lines in new excel file
    By shresthaprateek@gmail.com in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-11-2006, 02:25 PM
  4. reading data in to Access From Excel
    By nuti in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-04-2006, 09:55 AM
  5. Write value to an Excel VBA variable by reading Access DB?
    By Alan Ibbotson in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-11-2005, 08:05 PM
  6. [SOLVED] reading from text file to excel file
    By dgoel in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-18-2005, 03:06 PM
  7. [SOLVED] MS Excel data reading in MS Access
    By Paul in forum Excel General
    Replies: 1
    Last Post: 01-27-2005, 08:06 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1