p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   Access VBA (http://p2p.wrox.com/forumdisplay.php?f=80)
-   -   [?] Line numbers in VBA (http://p2p.wrox.com/showthread.php?t=20702)

Chantale November 1st, 2004 06:44 PM

[?] Line numbers in VBA
 
Is there any way to display line numbers for my code in VBA for Access 2000? I'm trying to use the Erl function to make my error trapping a little less cryptic.


mmcdonal November 2nd, 2004 11:14 AM

Hi,

   You need to add the line numbers to the code yourself in order to use this function. Then you should be able to do something like this in your error handling:

"Line: " & Erl

   You must have a ton of code if you want to use this old function. It still works in VB.NET if you want to go to the trouble of entering these numbers yourself.


mmcdonal

Chantale November 2nd, 2004 12:51 PM

Yeah.. I do have alot of code. I've got code behind 2 forms, and I have 8 modules. My application rips through thousands of lines in a batch of text files and parses out in-line strings, then validates them against an oracle table and generates a weblink for each in access if the strings are valid, and creates an excel spreadsheet for invalid strings, plus the business rules they break.. I get through so many files, then I get an error. Breakpoint + F8 isn't efficient if I have to go through thousands of lines in the files before I encounter a problem :( Darn VBA for not having line numbers!


Braxis November 2nd, 2004 02:10 PM

Is the problem big enough that it's worth throwing money at?

There is a line numberer included in FMS Inc's Code Tools package. The downside? It costs $299 for a single user license.

http://www.fmsinc.com/products/CodeTools/index.html


Brian Skelton
Braxis Computer Services Ltd.

Chantale November 2nd, 2004 03:22 PM

I took a look at that yesterday. My company doesn't want to buy it.. Tho from my view, it would save $ in the long run if I'm not spending so much time searching for where the error takes place [:p]


SerranoG November 2nd, 2004 05:15 PM

You really don't need line numbers. Whenever there's a run-time error and you click DEBUG, the VBA window opens and the offending error is highlighted in yellow. Holding your mouse over most varibles at this point tell you their values at that stage of the run.

Greg Serrano
Michigan Dept. of Environmental Quality, Air Quality Division

Braxis November 3rd, 2004 07:17 AM

Line numbers are very useful if you're using compiled databases (mde 's or ade's) and your users are using the runtime version of Access.

Runtime Access can often generate errors that do not occur whilst using the full version and having line numbers to pinpoint errors is a life saver.

The line numbering is a minor component of FMS's Code Tools package. It's most useful features include procedure templates, error trap templates and code cleaning. I bought a copy and have never regretted the investment.


Brian Skelton
Braxis Computer Services Ltd.


All times are GMT -4. The time now is 11:47 PM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.