Solved

VB Code debugging in Access

Posted on 2006-07-14
3
247 Views
Last Modified: 2010-04-17
Hi all,

i have some code written by a colleague who has now left which takes data written into an access/sql adp and writes it into a word document.

the problem im having is that it's not producing any word docs yet is not producing any error messages when it's run, how can i find out which element is causing it to fail when the code is not actually failing?

does this make sense? normally the access debugger will immediately point to the part of code where the problem lies but it's not as it doesn't recoignise a problem but obviously somewhere it is failing.  

I will add more points if need be just need an old q refunded first

cheers

greg
0
Comment
Question by:Dubs
3 Comments
 
LVL 21

Accepted Solution

by:
MogalManic earned 20 total points
ID: 17106994
There are a few things you can try:
 -You can set a breakpoint at the onclick event that starts the process and the debugger will start
 -You can use Debug.Print to insert debug messages in the console
     eg. Debug.Print intCount & ": " & rst![ID] & ", " & rst![Name]
 -You can insert a Debug.Assert or stop statement to stop debugger at key points based on a condition

For more detail, see this link:http://www.fmsinc.com/tpapers/vbacode/Debug.asp#WritingCodeforDebugging
0
 
LVL 6

Expert Comment

by:davbouchard
ID: 17112338
Maybe there is a line in the code which does "on error resume next". This will skip errors. What you could try is setting alt on all errors from the menu.

If you get nothing, then there must be a logical problem with the code. You will have to look and see what it actually does. Has the code ever worked before?
0
 

Author Comment

by:Dubs
ID: 17120187
i found out what was happening, the software had moved drive so on it's original drive it brought up the save as dialog but on the new drive it didn't.  not sure why

sorted now

greg
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Excel object stays open 19 65
firstChar challenge 13 87
VB6 Compile Compatibility Issue 4 42
groovy example issue 10 71
Displaying an arrayList in a listView using the default adapter is rarely the best solution. To get full control of your display data, and to be able to refresh it after editing, requires the use of a custom adapter.
A short article about problems I had with the new location API and permissions in Marshmallow
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

744 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now