Solved

Access VBA debug - make switchboard appear for user entry

Posted on 2012-03-13
6
518 Views
Last Modified: 2012-06-21
I am attempting to debug Access VBA code. When I set a breakpoint and choose Debug > Run to breakpoint nothing happens.  I need for the Switchboard to appear so that choices can be entered to progress through the code.  What's the magic word?   (Alt + F11 simply toggles to the Switchboard in design mode.)

thanks
0
Comment
Question by:lsmoore
  • 3
  • 2
6 Comments
 
LVL 77

Expert Comment

by:peter57r
ID: 37715464
I'm not clear from your description what is happening.

Are you saying that the code is not running or that the code is running but not stopping at the breakpoint, or something else.

Have you UNchecked the option 'Use Access Special Keys' in the startup options?  If so , that will prevent the Breakpoint from working.
0
 

Author Comment

by:lsmoore
ID: 37715518
The breakpoint is set (red line). I click Run to Cursor and nothing seems to happen.  Click F8 and I get a beep. I think the program is awaiting the user to make Switchboard choices, but I can't see the Switchboard.

Where is the "Use Access Special Keys"?
0
 

Author Comment

by:lsmoore
ID: 37715609
Incidentally, I've taken over someone else's project here.  When I click RUN, all I see are some Macros.  There does not seem to be an option run Run Form.  

thanks
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 77

Expert Comment

by:peter57r
ID: 37715738
A breakpoint is indicated by a BROWN blob in the left margin.  
RED code would indicate a syntax error in the code.

To single step through the code, first clcik the Reset button to be sure nothing is pending.
Then click into the procedure you want to run. And then press F8.  The procedure name should go yellow and you can then use F8 to step through the code.

If you still have a problem, you will have to post the code to get proper help.
0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 500 total points
ID: 37715841
Again, your ultimate question here is not clear...

Typically the switchboard is set to open when the DB opens, via the Autoexec Macro.

So before you start worrying about things like Breakpoints, ...
Lets make sure:
That you even have a switchboard form?
If so, can yo see it in the database window/Task Pane?
If yes, then can you open it on it's own?
If yes, then do you have an Autoexec Macro?
If so what happens when you run it.
0
 

Author Closing Comment

by:lsmoore
ID: 37716176
On my computer the breakpoint code line is bright red backcolor, with a red dot beside in the left margin.  (Code error shows red text.)
To make this debug work properly I had click VIEW OBJECT, then VIEW > FORM VIEW.  This displayed the Switchboard awaiting entry, and execution stopped at the breakpoint, as I wanted.

thanks for your help.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question