473,386 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Displaying Code modules

I would like to display the area within a code module where certain text appears.

The module concerned has numerous lines containing code such as:
If x Then AddErr 35
If y then AddErr 45
etc etc

The code below works (from a form or other module)

Dim l1 as long, l2 as long, c1 as long, c2 as long
Dim bolFound as Boolean
Dim mdl as module
DoCmd.OpenModule "modProcessingBS"
Set mdl = Modules("modProcessingBS")
bolFound = mdl.Find("AddErr 35", l1, c1, l2, c2, True)
debug.print bolFound

Always bolFound is True, but the module display is where it was last opened, not where the line containing "AddErr 35" is to be found. I swear that earlier today Access did exactly this, but no longer. Frustrating. Can anyone help?

I am using Access 2002 - although I doubt it makes much difference!

Many thanks to anyone who can help!
Oct 9 '07 #1
3 1280
nico5038
3,080 Expert 2GB
Don't know why you want the module to open at the found line, but why not use the Edit/Find to determine the location ?
This allows a search per function, module or even all code with a full or partial match of the string....

Nic;o)
Oct 9 '07 #2
Don't know why you want the module to open at the found line, but why not use the Edit/Find to determine the location ?
This allows a search per function, module or even all code with a full or partial match of the string....

Nic;o)
Well, when I view error 35, I want to be able to go straight to the code that generates that error. Why don't I want to use find? Quite simply, it is slow
Oct 11 '07 #3
nico5038
3,080 Expert 2GB
Hmm, a slow find is new to me. I've been using it many times and certainly when you have just one module (and set the Find to the "Within Module" scope) I never experienced slow performance.

I only use the module object for extensive automated updates and your .find is a new approach for me :-)

Nic;o)
Oct 11 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

242
by: James Cameron | last post by:
Hi I'm developing a program and the client is worried about future reuse of the code. Say 5, 10, 15 years down the road. This will be a major factor in selecting the development language. Any...
13
by: AFKAFB | last post by:
Hi Sometimes when i edit previously saved VBA code e.g. To update field names etc the revised code does not work. Even if i copy and paste in a previous version it does not work. The only...
3
by: Typehigh | last post by:
I am a good programmer, but this one stumps me! I have a form with a continuous subform. The continuous subform contains records of data and may reach a depth of 1000's of entities. I have...
3
by: Double Echo | last post by:
Hi all, I'm using PHP 4.4.2, and use PHP on both the command-line and the web. I am running PHP on SuSE 10 Linux , in a VMware 5.5 workstation, using Apache 2.0.55 , on my Dell laptop. ...
4
by: DQ | last post by:
I just signed up for a web hosting service. They have PHP, but can't tell me which modules (extensions) are installed. Is there a function, or some other easy way, to show all modules...
3
by: peterhall | last post by:
In VBA an Access module has a find method - works perfectly to find a string inside a module. i'm working in A97 (legacy) systems (large ones) and want to write code that searches all modules so that...
0
by: peridian | last post by:
Hi, I have the below code to transfer code modules between Access database files. I have three problems, only one of which is annoying. a) How do you prevent the Save As box from appearing...
2
by: Tree*Rat | last post by:
Trying to reduce alot of my codes size and am having no joy with this code. How can I get this smaller? // Block $prefix_length = strlen( PREFIX_BLOCKS ); $block_dir = @opendir($root_path ....
4
scubak1w1
by: scubak1w1 | last post by:
Hello, I have a series of database tables in PostgreSQL that I am getting data from and displaying in the web browser (via PHP, SQL, etc.) How about giving some details of what I am looking to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.