Solved

VB Code debugging in Access

Posted on 2006-07-14
3
258 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
This article will inform Clients about common and important expectations from the freelancers (Experts) who are looking at your Gig.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

856 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