No code being displayed on lAccess Visual Basic Screen.

George Stacy 0 Reputation points
2025-12-02T12:30:09.1733333+00:00

Worked in my Access Database yesterday and all was working fine. Today, when I go to my Visual Basic Screen, all my code is gone. The page is blank.

Microsoft 365 and Office | Access | For home | Windows
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Q&A Assist
    2025-12-02T12:30:15.93+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    If your code is not displaying in the Access Visual Basic screen, it could be due to a few reasons:

    1. Hidden Modules: Check if the module containing your code is hidden. You can unhide it to see if the code reappears.
    2. Missing References: If your database has missing references, it may cause issues with displaying code. You can check for missing references by going to the Visual Basic Editor, selecting Tools > References, and looking for any marked as MISSING.
    3. Corrupted Database: Sometimes, the database itself may become corrupted. You can try to compact and repair the database by going to Database Tools > Compact and Repair Database.
    4. Access Settings: Ensure that your Access settings haven't changed, which might affect the display of your code.

    If these steps do not resolve the issue, consider restoring from a backup if available.


    References:

    0 comments No comments

  2. Michelle-N 8,840 Reputation points Microsoft External Staff Moderator
    2025-12-02T13:41:16.2666667+00:00

    Hi @George Stacy

    Thank you for posting your question in the Microsoft Q&A forum.

    Based on the information you described, I understand that your Access Database was working fine yesterday, but today, when you open the Visual Basic screen, the page is blank, and no code is being displayed.

    To help me better diagnose the issue, could you please answer a few questions?

    • What version of Windows and Microsoft Access are you currently using?
    • When you are in the Visual Basic Editor, please try going to the View menu. What happens if you select Properties Window, Project Explorer and Code (as shown in the image below)? Do the windows reappear?

    User's image

    • If possible, could you please send me a screenshot of your Visual Basic screen via Private Message?

    In the meantime, please try setting the folder containing your database as a Trusted Location. Sometimes security settings can block the code from loading.

    1. Open Access and go to File > Options.
    2. Select Trust Center > Trust Center Settings.
    3. Select Trusted Locations.
    4. Click Add new location...
    5. Browse to the folder containing your .accdb file and add it.
    6. Restart Access and check if the code appears.

    Please provide the additional details so I can assist you further.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".   

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  3. George Hepworth 22,215 Reputation points Volunteer Moderator
    2025-12-02T13:58:18.7666667+00:00

    Please provide a screenshot of the Navigation Pane, showing modules. It'll look like this (with fewer modules, of course).

    User's image

    Also, as previously requested, show us a screenshot of your VBE, it should look something like this (again, with fewer modules):

    User's image

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.