Results 1 to 10 of 10
  1. #1
    Join Date
    Jan 2019
    Posts
    3

    Error: 'id' is not an index in this table. Unable to open the VBA code editor.

    I have a access 2016 application that has been working for several years. Today I have been changing some code and tables, and now I am unable to use the database. On opening I get the error: 'id' is not an index in this table. I get it three times, and then I only see my tables. I am unable to open the VBA code editor. I tried to compact and repair the database several times, but the problem remains. I tried to create a new (blank) database and import a table, but get the same error. I can open a table in design view and then change a field name. I cannot open any table. If I try to open a table I keep getting the error message, and I have to close the database through the Task Manager. I am working wit Windows 10 release 1803, and Access 2016.



    On internet I found some references to converting from an old database (access 2003 or even access 97) but that is not the case here. As mentioned before, it has been working for several years.

    Any idea how to open the database and find the cause? I can restore an old version, but that means several hours of work gone.

    Any help is appreciated.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,646
    Can try a decompile then recompile. http://www.fmsinc.com/MicrosoftAcces.../Decompile.asp

    But I think will have to go back to the good version and try again. Make changes incrementally and save after each change confirmed working.
    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
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,129
    It sounds like corruption or you've been hit by a bug related to the 1803 update with access 2016 / 365.
    Hopefully one of these will help you fix it:

    1. Try DECOMPILING your database to remove any corrupted code. It only takes a few seconds. See http://www.fmsinc.com/microsoftacces.../decompile.asp
    Make a backup first. Afterwards RECOMPILE from the Debug menu in the VBE
    If you still can't use the VBE, try opening using the shift to bypass startup code

    2. Whilst in the VBE, check for missing references

    3. Read this link documenting major unresolved issues with the Win1803 update: https://www.devhut.net/2018/06/13/ac...gnized-format/

    4. After you fix it, make sure you backup more regularly!
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  4. #4
    Join Date
    Jan 2019
    Posts
    3
    Hi guys,

    Thanks for the suggestions. Most of them are good practice and is what I do already. The "Decompile" option was new to me, but unfortunately it didn't work. So I will use a previous version and do the work again.

    Point is not that I don't want to use a previous version. I make backups regularly, and I have had to use them often enough. The frustrating point is that I am unable to open the VB editor. This morning I have tried several things, like deleting all tables and queries, and trying to export the form. Deleting tables and queries didn't help, and I was unable to export the form.

    I noticed another post from 2013 about the same problem (Access 2010) with the same conclusion: VB code corrupt and unable to export the code.

    Anyway, thanks again. I'll close the post.

  5. #5
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,706
    Did you try creating a new empty DB and importing everything into it from the bad DB?

  6. #6
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,129
    One other possible course of action which may be helpful.
    Repair errors in the system table MSysObjects.
    See this item on my website http://www.mendipdatasystems.co.uk/r...cts/4594424204
    Make a backup first if you try this
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  7. #7
    Join Date
    Jan 2019
    Posts
    3
    @davegri,
    Yes, I have tried that and it didn't work.

    @isladogs
    I have looked in some of the system tables, but couldn't find anything strange. Didn't know of the fantom objects however, so thanks for the link. Unfortunately is my problem that I can't write any VBA code, since that is just my problem. If I could open the VBA editor, I could copy all of my code and test it in new DB's, and my problem would be solved. The tables I can export from the corrupt database, or copy them from a previous, good working version.

  8. #8
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,129
    OK in that case create a new blank database and import all tables and queries.
    Make a backup just in case.
    Next try and import the forms and reports. If successful, is the code imported as well?
    If yes, repeat with macros and modules.

    If the form import failed, go to your backup you made and import forms, reports, macros and modules from that.
    Then you'll have the latest data and just need to redo recent changes to those items.
    If you really do backups very regularly, that shouldn't take that long!

    If even that fails, you can try the undocumented save as text then load from text options.
    However I doubt you will be able to do that as its likely too late.

    One last thing and I hope this doesn't come across as condescending.
    You say you can't open the VBE but haven't actually described what does happen.
    Just as a check, you haven't converted your database to an ACCDE by any chance?
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  9. #9
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,845
    from your description it sounds like your db is not split - this is probably the reason for the file becoming corrupted.

    Here is another link with suggestions as to how you may be able to fix your db http://allenbrowne.com/ser-47.html. Your error is mention about half way down

  10. #10
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,129
    Ah yes I remember that issue now but have never had a chance to test the fix in MSysAccessObjects on a real world database

    Axel:
    Would you be willing to upload a zipped copy of your database so I can also try that fix.
    If it contains confidential data in tables remove or amend that data but leave the rest intact
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

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

Similar Threads

  1. Replies: 3
    Last Post: 07-12-2017, 04:29 PM
  2. Replies: 2
    Last Post: 11-09-2016, 10:41 AM
  3. Replies: 9
    Last Post: 11-06-2016, 07:05 PM
  4. Index table on Open
    By doncarp in forum Access
    Replies: 1
    Last Post: 04-15-2016, 01:51 PM
  5. Replies: 3
    Last Post: 12-02-2014, 09:38 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