Share via

Can't open Visual Basic

Anonymous
2020-08-16T15:55:42+00:00

I have created a .accdb database which has been working fine for months.  It was working right up to close of play last night.  Today it is throwing up an error " 'Id' is not an index in this table".  It doesn't say what table and it doesn't say what to do about it.  After clicking OK many times I can get all tables to open and all queries, but I cannot open any forms or reports.  I can't even create any new forms.

I may be wrong but I have come to believe that the problem may be in a Visual Basic procedure which may somehow have got corrupted.  But here is the problem:  Visual Basic won't open.  If VB won'topen I can't debug the code, so where do I go from here? 

Help please!

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

8 answers

Sort by: Most helpful
  1. Anonymous
    2020-08-16T22:06:16+00:00

    In fairness, whenever I've seen this error, it's a system table that has lost its index "Id" as a result of corruption.  It's not necessarily the fault of a user-designed table.  All of the following system tables (normally hidden from the user) have (or should have) an index named "Id":

    MSysAccessStorage

    MSysAccessXML

    MSysNavPaneGroupCategories

    MSysNavPaneGroups

    MSysNavPaneGroupToObjects

    MSysObjects

    MSysResources

    Was this answer helpful?

    0 comments No comments
  2. Tom van Stiphout 40,211 Reputation points MVP Volunteer Moderator
    2020-08-16T21:34:06+00:00

    > all the backups are behaving in the same way.

    That is actually an important clue and points at something environmental. Get latest Office updates. If that does not help do an Office Repair.

    Was this answer helpful?

    0 comments No comments
  3. ScottGem 68,830 Reputation points Volunteer Moderator
    2020-08-16T21:24:43+00:00

    You never mentioned if you did a Compact or Repair. The error message indicates a C&R should help.

    By the way, it sounds like you accepted the default name of ID for your autonumber PKs. That's not recommended. I generally name my PKs tablenameID.

    Was this answer helpful?

    0 comments No comments
  4. Anonymous
    2020-08-16T20:21:31+00:00

    Thank you.  I will try all those suggestions.  I do have a backup (more than one), but I find that all the backups are behaving in the same way.

    Was this answer helpful?

    0 comments No comments
  5. Tom van Stiphout 40,211 Reputation points MVP Volunteer Moderator
    2020-08-16T15:59:11+00:00

    You may want to grab a backup (you DO have backups, right?), but perhaps decompiling the app will work as well (search online for "Access decompile").

    And/or holding down the Shift key while opening the database, to ensure your AutoExec macro does not run (if any).

    And/or check the References once you get the VBA window to open (Alt+F11).

    Was this answer helpful?

    0 comments No comments