Results 1 to 8 of 8
  1. #1
    BusDriver3 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    46

    Run Time Error 3022...

    Hello Access Community,



    I have a Access DB with no code, four tables, a few forms, a few queries, no relations... pretty much a flat file with about 2700 entries. I saved the file and then came back to it later in the day to continue working on it but got the 3022 Error.

    I can't seem to get around the error dialogue box so that I can remove any duplicate entries that might be in the table.

    I have tried to create a new database and "import" the data with no joy... I have tried to "compact and repair" with no joy... I have tried "click on open" no joy...

    Anyone have any luck or advice to get around the 3022 dialogue box so that I can get at the table?

    Thanks in advance.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Nevermind, you already tried importing.

    No idea. May be corruption beyond recovery.

    If you want to provide db for examination, follow instructions at bottom of my post.
    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
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    what is the description of the error you are getting - 3022 could be anything

  4. #4
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    This is a very long shot........



    EDIT THE FOLLOWING STRING TO THE FULL PATH OF YOUR MSACCESS EXECUTABLE AND THE FULL PATH OF YOUR dB - these are my paths
    ----------------------------------------------------------------------------------------------------

    "C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" "C:\AccMDB\ImportEmployees_FE_2014_02_24.accdb " /decompile


    copy the line and paste it into the RUN command




    INSTRUCTIONS
    ------------

    @Tim Lentine's practical instructions are good, but he leaves out the actual steps required for a decompile to be worth doing:

    1 backup your database.

    2 compact your database.

    3 using the shortcut created with Tim's instructions, open your database.

    4 close that instance of Access.

    5 open a new instance of Access and open the database you just decompiled, but BE SURE YOU BYPASS ALL STARTUP CODE (i.e., hold down the shift key). If you don't do that, then you might as well go back to step 3 and try again, since if the startup code runs, your code will recompile before you are ready to do so.

    6 compact the decompiled database (and be sure you hold down the shift key so that it bypasses the startup code; see #5).

    7 open the VBE and on the Debug menu, choose COMPILE [name of project].

    8 on the file menu, save the project.

    9 compact again.

    Why are all these steps necessary?

    Because you want to not just decompile the VBA, you want to make sure that all the data pages where the compiled p-code was stored are completely discarded before you recompile.

    I also recommend:

    1 in VBE options, turn off COMPILE ON DEMAND

    2 in the VBE, add the COMPILE button to your toolbar.

    3 compile often with that button on the toolbar, after every two or three lines of code.


    Decompile is not something you should use all the time, but during heavy-duty coding, I might do a decompile a couple of times a day. And I generally decompile/recompile as the last step before releasing an app into production use.

  5. #5
    BusDriver3 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    46
    Thanks for the responses... The error in question reads as such:

    "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."

    Any ideas?

  6. #6
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,801
    Did you get that message only once, or are you getting it repeatedly (like 2700 times) because you're stuck in some kind of loop? Have you been able to close the db (because you say you've tried to import to a new db - which I think you will not be able to do if it is in this error state). If you have closed it, then I'm wondering if a query/code/macro is trying to run upon opening and just repeating the problem. The message means you are trying to duplicate one or more field values in a table but it is not allowed because it violates a data validation rule. If the issue happens on opening, use the shift bypass and open again & you should be able to fix the problem.

  7. #7
    BusDriver3 is offline Advanced Beginner
    Windows XP Access 2010 32bit
    Join Date
    Jul 2011
    Posts
    46
    I wanted to say thanks for all of the input and suggestions but it looks like I have to start over from scratch... sad panda face :-(

  8. #8
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664


    Three rules of computing:

    1) Back up
    2) Back up
    3) Backup!!

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

Similar Threads

  1. Error Handeling for a 3201 and 3022 Error
    By starlancer805 in forum Access
    Replies: 3
    Last Post: 03-11-2015, 12:46 PM
  2. The Error 3022 Duplicate Problem
    By boywonder381 in forum Programming
    Replies: 21
    Last Post: 09-01-2014, 11:27 PM
  3. Replies: 3
    Last Post: 01-23-2014, 07:49 AM
  4. Replies: 4
    Last Post: 02-13-2013, 10:46 AM
  5. Replies: 0
    Last Post: 07-16-2012, 05:42 AM

Tags for this Thread

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