Solved Code Library (1 Viewer)

Yianni

Registered User.
Joined
May 15, 2017
Messages
40
I am looking for Information/examples of creating a Code Library that I can reference in Application

Thanks
 
You just need to go to Tools > References and add a reference to your code library database.
 
You just need to go to Tools > References and add a reference to your code library database.
I guess I need to clarify -I am looking for specific procedure as how to create the Library . A how to! Thanks. John
 
I guess I need to clarify -I am looking for specific procedure as how to create the Library . A how to! Thanks. John
Hi John. What sort of library are you looking for? To create one, you simply put all your reusable code in one database file.
 
You might want to consider an alternative to having a Library Database.

I don't use a Code Library because I feel it's dangerous to add another level of possible separation. I like to keep all my code in one place so that there are no problems in moving from one machine to another. However this does lead to the problem of how to manage/store my custom code? where do I keep it?

There is a very handy feature available to VBA programmers and it's the "Insert File" menu option. It's a builtin feature of, I suspect all Microsoft VBA utilising products.

Insert File
MS Access provides a folder which is accessed quickly and easily through the — >>>Insert >>>File — menu. This menu is shown when you are in the VBA interface. When you open it, you have access to this folder. You can have subfolders in any/all of those folders. You can have text files containing your code, Code Modules, Code Snippets, Class Modules, Anything Textual you Want! Clicking on any of the text files automatically copies the contents of that text file straight into your Code/Class Module. Follow this link to my website to see a YouTube explaining "Insert File":-

 
Last edited:
Thats a new one for me U.G.
I've always used MZ tools for simple procedures and my own code locker for more complex stuff.
This may be a lot easier than having to open a second DB to get code.
I think I'll spend the morning looping through my code locker to export them to text files.
 
Didn't Bob Larson create a database that held code snippets? I can't remember.

Edit: googled my own sentence 😆

https://btabdevelopment.com/free-access-tools/

It's written 32 bit needs tweaking.

1594567054805.png
 
Last edited:
Although I think Tony's suggestion is more convenient (thanks Tony!), here is the method I have tried in the past.

Although you did not ask for my opinion, I just didn't see much benefit from it...
 
Although I think Tony's suggestion is more convenient (thanks Tony!), here is the method I have tried in the past.

Although you did not ask for my opinion, I just didn't see much benefit from it...
Hmm, I use something simliar

But I also use MZ Tools because it allows me to use shortcuts to quickly insert code I use constantly, less typing.
 
I don't use a Code Library because I feel it's dangerous to add another level of possible separation. I like to keep all my code in one place so that there are no problems in moving from one machine to another

Yes but never mind the possible separation as that is the least of the worries.

The temptation to just quickly make a minor fix or extension to something in the library can lead to breaking a lot of other databases that already use the library. The potential for this leads to doing what you would think is safe by never changing an existing element in the library. So you add new similarly named features, defeating the point of having the library. Eventually those similarities will bite you too.

Code libraries need very very thorough documentation and a full record of where they have been implemented.
 
Thanks, I will follow up
Thats a new one for me U.G.
I've always used MZ tools for simple procedures and my own code locker for more complex stuff.
This may be a lot easier than having to open a second DB to get code.
I think I'll spend the morning looping through my code locker to export them to text files.
Thanks, I will follow up john
You might want to consider an alternative to having a Library Database.

I don't use a Code Library because I feel it's dangerous to add another level of possible separation. I like to keep all my code in one place so that there are no problems in moving from one machine to another. However this does lead to the problem of how to manage/store my custom code? where do I keep it?

There is a very handy feature available to VBA programmers and it's the "Insert File" menu option. It's a builtin feature of, I suspect all Microsoft VBA utilising products.

Insert File
MS Access provides a folder which is accessed quickly and easily through the — >>>Insert >>>File — menu. This menu is shown when you are in the VBA interface. When you open it, you have access to this folder. You can have subfolders in any/all of those folders. You can have text files containing your code, Code Modules, Code Snippets, Class Modules, Anything Textual you Want! Clicking on any of the text files automatically copies the contents of that text file straight into your Code/Class Module. Follow this link to my website to see a YouTube explaining "Insert File":-
nks.
 

Users who are viewing this thread

Top Bottom