AC 2003 How to Force a break into debugger ?

Hi,

Is it possible to force an access procedure to enter the debugger and break 
when there is an error? I'm trapping errors using the standard errorhandler 
methods, but I am stuck in a loop, and I would like to find out where the 
problem is.

 Is there any code that I could place in my error handler to force  vba to 
stop running code and enter the debugger iwhen  it encounters a particular 
error number?

Here's what my error handler looks like now...

ErrorHandlerExit:
    Exit Sub

ErrorHandler:
    MsgBox "Error No: " & Err.Number & "; Description: " & Err.Description
    Resume ErrorHandlerExit

In this case I get an Error# 91, but when I hit the ok button on the MsgBox 
the program immediately gives me the same error again. 

- David

0
Utf
6/14/2007 11:20:00 PM
access 16762 articles. 2 followers. Follow

2 Replies
1603 Views

Similar Articles

[PageSpeed] 25

When you get an error message press Ctrl+Break, that will stop the code and 
will locate the debuger to this line (yellow line):

Resume ErrorHandlerExit

Cange it to (adding  single quote)
Resume  ' ErrorHandlerExit 

so it wont exit the sub
Hit the F8 key, to step through the code
The Resume will move the debuger to the line that got the error

Hints:
F8 used to step line by line in the code
F5 used to run the code without steps
F9 used to insert a code break or undo the code break where the cursoris 
located in (red line)

Note:
don't forget to change this
Resume  ' ErrorHandlerExit 

Back to this
Resume ErrorHandlerExit 

-- 
Good Luck
BS"D


"david101" wrote:

> Hi,
> 
> Is it possible to force an access procedure to enter the debugger and break 
> when there is an error? I'm trapping errors using the standard errorhandler 
> methods, but I am stuck in a loop, and I would like to find out where the 
> problem is.
> 
>  Is there any code that I could place in my error handler to force  vba to 
> stop running code and enter the debugger iwhen  it encounters a particular 
> error number?
> 
> Here's what my error handler looks like now...
> 
> ErrorHandlerExit:
>     Exit Sub
> 
> ErrorHandler:
>     MsgBox "Error No: " & Err.Number & "; Description: " & Err.Description
>     Resume ErrorHandlerExit
> 
> In this case I get an Error# 91, but when I hit the ok button on the MsgBox 
> the program immediately gives me the same error again. 
> 
> - David
> 
0
Utf
6/14/2007 11:48:00 PM
In news:6BDB3DE0-69C8-40E5-9821-3825CE160589@microsoft.com,
Ofer Cohen <OferCohen@discussions.microsoft.com> wrote:
> When you get an error message press Ctrl+Break, that will stop the
> code and will locate the debuger to this line (yellow line):
>
> Resume ErrorHandlerExit
>
> Cange it to (adding  single quote)
> Resume  ' ErrorHandlerExit
>
> so it wont exit the sub
> Hit the F8 key, to step through the code
> The Resume will move the debuger to the line that got the error
>
> Hints:
> F8 used to step line by line in the code
> F5 used to run the code without steps
> F9 used to insert a code break or undo the code break where the
> cursoris located in (red line)
>
> Note:
> don't forget to change this
> Resume  ' ErrorHandlerExit
>
> Back to this
> Resume ErrorHandlerExit

Ofer, I don't think it's a good idea to modify code while the 
application is running.  That has been known to lead to corruption of 
the VB project.

I suggest instead that David simply set one or more breakpoints in his 
code, so that the code stops at the breakpoint(s).  Then he can 
single-step through it to investigate the problem.

-- 
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


0
Dirk
6/15/2007 4:50:30 PM
Reply:

Similar Artilces:

VC++.Net 2003
I've seen few months ago that it is possible to buy (full version of) VC++.Net 2003 only, and not to have to buy whole Visual Studio.Net 2003. If I remember good, the price was $99. Have someone bougth this product? Is it limited functionality edition? What are the differences, comparing one from VS.Net 2003? Thank you. "Jan Plastenjak" <none@ms.com> skrev i meddelandet news:uxjaz3SIEHA.2948@TK2MSFTNGP11.phx.gbl... > > I've seen few months ago that it is possible to buy (full version of) > VC++.Net 2003 only, and not to have to buy whole Visual St...

Exchange 2003 #23
Not sure if this is the right newsgroup, please tell me if its not. I have recently setup an exchange 2003 server, I setup all the users and mailing groups and they all showed up fine in outlook. I have added more user and mailing groups since setting the server up but they are not showing in outlooks address book. Any ideas why this is? Thanks in advance for any help. Cheers Pete Thompson Pete- How long ago did you add them? It takes a while for the address book to rebuild. -- -- Brian Desmond Windows Server MVP desmondb@payton.cps.k12.il.us Http://www.briandesmond.com "Pet...

Outlook 2003 & BCC
I sent an email to a bunch of people and I BCC'd them all, I copied myself as well. Now, I'd like to determine whom I sent the email to. How can I see who I BCC'd? The copy in the Sent folder does not contain the information. Thanks Have you opened the email in the Sent Item folder "eblaster" <eblaster@comcast.net> wrote in message news:%23Gmp4ovnEHA.3564@tk2msftngp13.phx.gbl... > I sent an email to a bunch of people and I BCC'd them all, I copied myself > as well. Now, I'd like to determine whom I sent the email to. How can I > see who I ...

Exchange 2003 on WIndows 2003
I installed SP1 and now my exchange server page file is huge. Has anyone had this problem. I did the When you are running Exchange 2003 SP1 on Windows Server 2003 with more than 1 GB of RAM, it is recommended that you set the SystemPages registry key to zero. This recommendation contrasts with the recommendation for Windows 2000 Server, which is to set SystemPages to a value between 24000 and 31000. The recommended memory settings for Exchange 2003 SP1 on Windows Server 2003 with more than 1 GB of RAM are as follows: a.. If you host mailboxes or public folders on a server with more ...

Outlook 2003 Hanging #2
I have this silly problem with Outlook 2003 SP2 hanging. I'll be chugging along, opening emails, and all the sudden it will slow down to nothing and then hang. I've installed all the latest updates for Office. Event Viewer is showing nothing useful - just HungApp. Does anyone have a clue what could be causing this? ...

Sorting Columns
I have a worksheet that contains data in a format something like: ID# Name Score 1 Bill 24 2 Jack 3 4 Sue 88 The cell contents are the result of formulas referring to other parts of the worksheet and other worksheets in the spreadsheet. The ID# column is always sequential (incluidng the blank line), but the other columns are in any order. I need to sort the columns by descending score ignoring the blank lines, giving: ID# Name Score 4 Sue 88 1 Bill 24 2 Jack 3 Data -> Sort -> Descending insists on pu...

Help in Excel 2003
In the older Excel 2000, when I right-click on a heading in the Help Table of Contents, I get a choice of Open all, Close all, or Print .... Choosing "Print ..." then gives me a dialog box with two choices--Print the selected topic, or Print the selected heading and all subtopics. Is there an easy way in Excel 2003 to get this choice of Printing the selected heading and all subtopics? Right-clicking on a Table of Contents heading in Exccel 2003 does not present me any choices; it does nothing. Perhaps there is a setting I can change somewhere to make the Excel 2003 Help sys...

Outlook 2003 #22
I've recently upgraded my outlook to 2003. I've this problem. I used to be able to access my public folder from my mail. But from 2003, I need to "GO->Folder" then click public folder. The next time I login, I will need to do the same. Anyway to make the same as the previous version than public folder is always able to be access from my inbox? ...

Pub 2003 and NAV
I googled the issue about opening older version Pub files and NAV conflict, but was unable to find info about the 7.6 Corporate version of NAV to see if it causes the same problem. I was able to find the below articles on it, but they don't talk about the Corp. version. Does anyone here know? Thanks. http://service1.symantec.com/SUPPORT/nav.nsf/396b6ccde72d4a4d882569fc006071d 4/5cdbff470712ffd68525680300620012?OpenDocument http://support.microsoft.com/default.aspx?scid=kb;en-us;810041 -- Hermes hermes wrote: > I googled the issue about opening older version Pub files and NAV >...

GroupShield v6 for Exchange 2003...
We're looking at Groupshield v6 for Exchange 2003. I'd be very interested in peoples comments on the product or any pointers, how have they found working with it re stability etc. Is there any gotcha's to look out for... Thanks in advance. Karl, Run, very fast, as far away from Groupshield as you possibly can. In my experiences with testing Groupshield on Exchange 5.0/5.5/2000, every time that software was tested, something horrible happened to the lab servers. Major impact on performance, inability to properly notify on virus detection, stranded accounts, permissions ...

AC/DC
AC/DC es una banda de Rock formada en Melbourne (Australia), en 1973, por los hermanos Malcolm y Angus Young. Sus �lbumes han sido vendidos en numerosos pa�ses, con un total estimado de 150 millones de copias,[1] y su �lbum Back in Black vendiendo m�s de 21 millones en Estados Unidos y 42 millones en todo el mundo, haci�ndolo el segundo �lbum m�s vendido de la historia. [2] Aunque el grupo es considerado como pioneros del rock pesado y el heavy metal junto con Kiss,Led Zeppelin, Deep Purple y Black Sabbath,[3] sus miembros refirieron su m�sica como rock & roll. ...

Outlook 2003 command line switch
What is switch in OUTLOOK 2003 to specify the SUBJECT and BODY? In OL 2000 /m switch allows to specify mailto:email?subject=something&body=something etc. This DOES NOT work in OL 2003. Any1 has any idea why this won't work? tia this works for me: (all one line) "C:\Program Files\Microsoft Office\OFFICE11\OUTLOOK.EXE" /c ipm.note /m a@slipstick.com;b@slipstick.com?subject=something&body=something -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide) Author, Google and Other Se...

AC 2007 runtime
This has been asked before, but I don't understand how the answer relates to the question. I want to make a runtime application from a working ac 2000 file. I downloaded the runtime executable file , opened it and got the successfully downloaded message. How do I use it?. Nothing leads me to it when I open a file. What I am asking is so basic that a knowledgeable person may shoot over my head. If possible, I would hope to get something that says "To make a runtime file, click "x" or goto "y" or whatever. Thanks in advance.. You download A2...

Outlook 2003 comes up, then crashes, no error message
I have been using Outlook 2003 for a few years. Now when I start Outlook 2003 the splash window comes up, then the application window comes up. After about the normal time for initialization, the application window closes and the application appears to have abended. On subsequent attempt to start Outlook 2003 get the same result except get "file not closed properly" message. Have tried running scanpst.exe, uninstalling and reinstalling all of MS Office 2003, but no difference. Have also tried copying the outlook.pst data file to another computer with Outlook 2003, and no proble...

Uninstall of Symantec Corporate 9 breaks Outlook 2003
Hi Have worked on this for two days and gotten no where!! :( I have a client who has Symantec Antivirus Corporate Edition v9 deployed We are wanting to move them over to NOD32 After Uninstalled Symantec Antivirus from a PC, No Errors from uninstall, Outlook 2003 can no longer access pop or Smtp ports on the internet. What is really wierd is 1: Outlook express on the same PC can access the pop and smtp ports on the internet 2: Using Telnet on the same pc you can access port 110 and 25 ports on the internet 3: If you goto the control panel and access the mail icon, open a profile and test ...

Outlook 2003 #277
Using Office 2003 Outlook starts and tries to use MS Word as the default email editor. I don't want it to use this editor. I've disabled it on the Tools menu, Options, Mail Format tab but it seems to revert to it. How do I change the setting and what editor can I use in its place? mrpierce@optusnet.com.au.nospam <observer@optusnet.net.au.nospam> wrote: > Using Office 2003 > Outlook starts and tries to use MS Word as the default email editor. > I don't want it to use this editor. > I've disabled it on the Tools menu, Options, Mail Format tab but it > ...

do I still need to log in to hotmail ac
Hi, if I use window live mail to download/send mail for my hotmail ac, do i still need to log it hotmail.com for at least 3 month to keep it active ? Also, what about gmail and yahoo mail. Thanks a lot, Danny Using an account through Web access or by accessing with an email client keeps an account active. -- Ron Sommer MS MVP-Mail "Danny" <Danny@discussions.microsoft.com> wrote in message news:F520B5DF-85AE-412C-8A27-4486D30D1ABF@microsoft.com... > Hi, if I use window live mail to download/send mail for my hotmail ac, do > i > still need ...

Excel 2003 - VBA
Does anyone out there have a good source for reference material (beginner please) on the listbox function that would help with the following task. I have created a 2 column, 50 row listbox, fed from a 2000 element table in the spread sheet. Column one is the item number and column 2 is the name. I also have 2 textbox fields where I can enter either the number or the name and would like the listbox to scroll so that the matching item is displayed in the center, or as close as possible, of the 50 row window. I have found many sources of information on the listbox and have figured out much of ...

Publisher 2003 + Web
I need help Wen i create a link with ipertex it's not visible in the Web, what's happen? thx Quando provo a creare un collegamento ipertestuale e faccio una anteprima pagina web o provo a pubblicarlo, il link non si visualizza, dove sbaglio? Grazie ...

LDAP question Outlook Xp/2003
Hi, This issue have probably been discussed before, but so far I have not been able to find the answer I am looking for. I need to use "LDAP" against my Exchange 2003 server from Outlook Xp/2003 because some of my users need to access more than one Exchange server on the LAN. It is no problem accessing several servers using standard connection against one servers and "IMAP" against the others. However I have to use "IMAP" against my Exchange 2003 server and then I have a problem accessing the address lists on this server. Therefore I was hoping that I ...

Outlook 2003 font size problem
Good Morning People, I have a problem with the size of a font being displayed. HWtas happening is that When I create a new e-mail I use a size 10 font but whats happening it is displaying but the font looks more like a size 12, so what i did is reduce it to 8 which then looks like a size. Any explination to what is going on and any solution to whats going on. Many Thanks Slim ...

Exchange 2003 Native Mode
All, We just moved to Exchange 2003 native mode after retiring multiple Exchange 5.5 sites. Now it is useless to have the MTA Stacks service running on the servers. How do you remove the MTA queue from Exchange if it is no longer going to function? As of now, in the queue viewer, there is a red X on the MTA queue, even though no messages are being passed through that connector. No one likes red X's. Any help would be appreciated. Thanks. http://support.microsoft.com/default.aspx?scid=kb;en-us;810489&Product=exch On Tue, 9 Nov 2004 13:03:04 -0500, "Jim" <NoReply@...

Excel 2003 functions
I would like $D27 in this function to increment the row by 1 as I copy to other columns to the right of it. How do I do that? =IF(AND(AND(YEAR($A7)=YEAR($B$1),MONTH($A7)=MONTH($B$1)),$B$7=$D$27),$C7,0) I would appreciate any help I can get on this one. Thanks. =IF(AND(AND(YEAR($A7)=YEAR($B$1),MONTH($A7)=MONTH($B$1)),$B$7=INDIRECT(CHAR( 64+COLUMN(D1))&"27")),$C7,0) -- HTH Bob Phillips "dacm19" <dacm19@discussions.microsoft.com> wrote in message news:AF1D9717-1373-4B29-9332-0E6A145850F5@microsoft.com... > I would like $D27 in this function to increme...

Windows 2003 and Exchange 2003
We have recently purchased a company which has the following setup... 3 Windows 2003 Servers Standard Edition Exchange 2003 Server currently has 2 servers setup company 1 and company 2 I am looking for information on how best to reconfigure the Servers, Exchange and Active Directory as they are currently part of 2 companies, Company 1 has been bought and Compnay 2 has been sold to nother party. Does anyone have information or point me in the direction of information which would assist me with what needs to be done. Hope this makes sense. Many Thanks S You'll have to provide more...

Renaming an Exchange 2003 Cluster
Hello! Hope this is possible. I am currently planning on moving our Exchange 2003 stand alone svr to a A/P cluster. Basically this is what I plan. Join the cluster to the site under new name, then move everyone to this cluster, bring down the stand alone cluster, rename the cluster to the old svr and WALLA!. but I am just not sure if I can rename an Exchange Cluster. Any advice or insight would be tremendously appreciated. Thanks in advance. Marc J Even without getting on the cluster side of things, you should not rename a server once you have Exchange setup on it. Is there a ...