Share via

Switchboard not working

Anonymous
2020-05-09T19:53:20+00:00

Our Access database has been running without modification since July 21, 2018. Recently, the database does not always start. The bug is with at least two different Windows 10 computers. If we open file explorer, walk to the data base folder, and click the .accdb file, it opens correctly. If we open the Access program, click "Open", then "Browse", walk to the data base folder, and click on the .adddb file, it also opens correctly. However, if we open the Access program, click "Open", then click on the database from the recent databases screen, it does not start and we see a Macro Single Step error box. The error is:

Macro Name - Switchboard : Form : OnOpen : Embedded Macro

Condition - blank

Action Name - SetTempVar

Arguments - SwitchboardID, DLookUp("SwitchboardID","Switchboard Items","[ItemNumber] = 0 AND [Argument] = 'Default'")

Error Number - 2001

The first thing I tried was to compact and repair the database. No joy.

Just to make sure this isn't a Trust Center issue, I added the database folder as a trusted location and also turned on Allow Trusted Locations on my Network (not recommended). Still not OK.

If I go to Current Database Options and change the default display form from Switchboard to something else, the database always starts correctly.

I tried deleting the Switchboard and building a new one with just two options. The database does not start.

My Access version is Microsoft 365 MSO (16.0.12730.20144) 32-bit

Can you help?

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

Answer accepted by question author

Tom van Stiphout 40,201 Reputation points MVP Volunteer Moderator
2020-05-15T15:28:49+00:00

Thanks to a suggestion from the Access team we now have a workaround.

The problem appears to be with calling Domain Aggregate Functions like DLookup at startup time. The workaround is to write a DLookup replacement that uses standard recordsets. I did that in the link below.

Steps to fix:

Download the file provided below. Copy the module modReplacementFunctions to your application.

Design the Switchboard form. Design the macro in Form_Open. Observe that it uses a few calls to DLookup. Replace those calls with myDLookup, leaving the rest alone.

Save and Close. This should fix the problem.

Download the code from here:

https://1drv.ms/u/s!AnmKsZFxs8\_Kh8puQaxLiuVNIA9oMQ?e=WaIxLy

Was this answer helpful?

4 people found this answer helpful.
0 comments No comments

Answer accepted by question author

Anonymous
2020-05-15T00:56:27+00:00

can you tell me what the new substitute for a switchboard is and how to build it??

Was this answer helpful?

3 people found this answer helpful.
0 comments No comments

19 additional answers

Sort by: Most helpful
  1. Tom van Stiphout 40,201 Reputation points MVP Volunteer Moderator
    2020-05-09T23:21:39+00:00

    In that case I would export all objects to a new database.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2020-05-09T21:25:55+00:00

    Of course. I deleted the form and the table.

    Was this answer helpful?

    0 comments No comments
  3. Tom van Stiphout 40,201 Reputation points MVP Volunteer Moderator
    2020-05-09T21:05:27+00:00

    If you delete the Switchboard form you also should delete the Switchboard Items table.

    Was this answer helpful?

    0 comments No comments