How can I create an Access extension for editing code following a particular key combination? (3 Viewers)

amorosik

Active member
Local time
Today, 23:20
Joined
Apr 18, 2020
Messages
738
I use MZ-tools, and one of the features I use most frequently is adding error routines, line numbering, and line de-numbering
Many forum users will surely be familiar with Mz-Tools, as it's a truly useful tool
How can I achieve the same effect (inserting a few lines of code with variables taken from the current sub/function name) from VBA code or an external program?
Let me explain, if I wanted to create a system similar to Mz-Tools, limited to these two features, how would I go about it?
 
This looks like yet another of your many purely speculative questions that you have no intention of doing.
As you stated, VBE add-ins such as MZTools & VBE_Extras do the job perfectly well so its probably a purely academic exercise.

However, you could in theory do this with VBE Extensibility code
Having tried this a few years ago, its not too difficult to remove existing line numbers
Go through the code line by line, check for line numbers at the start, parse the line contents and remove the leading characters

Its much more difficult to add line numbers although in principle the idea is similar.
The reason its more difficult is you have to take into account all the exceptions such as:
  • procedure header / footer lines
  • comments
  • first line after Select Case
 
How can I achieve the same effect (inserting a few lines of code with variables taken from the current sub/function name) from VBA code or an external program?
Are you aware that the MZ-Tools Code Library allows you to define custom code snippets that can be easily inserted into your code?
 
This looks like yet another of your many purely speculative questions that you have no intention of doing.
As you stated, VBE add-ins such as MZTools & VBE_Extras do the job perfectly well so its probably a purely academic exercise.

However, you could in theory do this with VBE Extensibility code
Having tried this a few years ago, its not too difficult to remove existing line numbers
Go through the code line by line, check for line numbers at the start, parse the line contents and remove the leading characters

Its much more difficult to add line numbers although in principle the idea is similar.
The reason its more difficult is you have to take into account all the exceptions such as:
  • procedure header / footer lines
  • comments
  • first line after Select Case

Why do you think I don't put into practice the advice that I think solves the question asked?
Also, why do you think a theoretical exercise is less important than something you actually use in some application?
 
Are you aware that the MZ-Tools Code Library allows you to define custom code snippets that can be easily inserted into your code?

Of course, I wrote about this function
How to create a similar functionality in house
 
Most of the people who participate in this forum are working professionals who have employers or clients to satisfy. Some of us are retired, though, and often look for time-filler projects to both contribute something to the Access community and to keep our skills as sharp as possible.

Your project is aimed at neither group. Those who must work for a living generally don't have time to take on unpaid side projects like yours, especially when there are existing tools available. Those who have free time may, or may not, find it worthwhile to complete your project for you. I, for one, have plenty of other interesting ideas and projects to pursue and am not looking to reinvent tools that I have already available to me in MZ-Tools.

If you are looking for ways to fill your free time with projects like this, by all means go for it.
 
Last edited:
Of course, I wrote about this function
How to create a similar functionality in house
You just mentioned the error handler, which doesn't necessarily means that you are aware of the very similar but separately available Code Library functionality of MZ-Tools.

If you want to implement similar functionality, either directly in VBA or in an external component, the most common and probably only workable approach is using the VBA Add-in Model, which is provided by the VBA Extensibility library @isladogs already mentioned.
 
Why do you think I don't put into practice the advice that I think solves the question asked?
Also, why do you think a theoretical exercise is less important than something you actually use in some application?
Despite the numerous questions of this type that you post, and the often lengthy and detailed responses from many experienced developers on this forum, I have never yet seen you provide a working example that you have then gone on to code yourself.

If I'm wrong and you have created useful code in response to this type of question, perhaps you could give something back to the forum by posting examples in the code repository or sample databases sections.
 
Despite the numerous questions of this type that you post, and the often lengthy and detailed responses from many experienced developers on this forum, I have never yet seen you provide a working example that you have then gone on to code yourself.

If I'm wrong and you have created useful code in response to this type of question, perhaps you could give something back to the forum by posting examples in the code repository or sample databases sections.

That you're wrong is sure
"..I have never seen..." yes, maybe you're not seeing clearly
 
So there are two of you who can't see well
Count me in.
Your idea of seeing (not) well is rather far fetched here. Some day dozens of new posts are made to this site. Some people may be away for a couple of days. - Long story short, it is very easy to miss things here.
Yes, I know it was @isladogs who brought up the "I have never yet seen" phrase, but the efficient way to point to certain content on this site is by posting a link to it.
 
So there are two of you who can't see well
Insulting other people is not the same as providing concrete examples to prove a point.

This response falls under the same approach as the one which started this discussion: asking others to provide you with a way to create line numbers in VBA. You want the benefit of that tool, but expect someone else to do the basic work to create it for you.

Now, you want others to waste their time looking for examples you've uploaded showcasing your contributions.

You are fond of collecting sayings. Here's one that's blunt, and to the point: Put up or shut up.

It means show us an example of what you are talking about or stop talking about it.
 
Here we are again; negative comments……
Thought this had stopped!

If you cannot help simply don't answer i suggest otherwise we get where we are now……
 
Just search, anyone can scroll through the posts of any user and check for themselves
And with that you just made my point :rolleyes:.

You started out by asking other people to do the hard work of coming up with VBA code that replicates something already in existence.

And you end by asking other people to do the hard work of trying to track done something that we suspect doesn't really exist.

It's not hard. You know what content you've shared here. Finding it and posting a link to it will quickly end the discussion.
 

Users who are viewing this thread

Back
Top Bottom