Solved Code Library (1 Viewer)

Yianni

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

Thanks
 

theDBguy

I’m here to help
Staff member
Local time
Today, 02:41
Joined
Oct 29, 2018
Messages
21,357
You just need to go to Tools > References and add a reference to your code library database.
 

Yianni

Registered User.
Local time
Today, 05:41
Joined
May 15, 2017
Messages
40
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
 

theDBguy

I’m here to help
Staff member
Local time
Today, 02:41
Joined
Oct 29, 2018
Messages
21,357
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.
 

Uncle Gizmo

Nifty Access Guy
Staff member
Local time
Today, 09:41
Joined
Jul 9, 2003
Messages
16,243
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:

moke123

AWF VIP
Local time
Today, 05:41
Joined
Jan 11, 2013
Messages
3,849
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.
 

AccessBlaster

Registered User.
Local time
Today, 02:41
Joined
May 22, 2010
Messages
5,823
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:

NauticalGent

Ignore List Poster Boy
Local time
Today, 05:41
Joined
Apr 27, 2015
Messages
6,280
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...
 

GinaWhipp

AWF VIP
Local time
Today, 05:41
Joined
Jun 21, 2011
Messages
5,901
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.
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 20:41
Joined
Jan 20, 2009
Messages
12,849
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.
 

Yianni

Registered User.
Local time
Today, 05:41
Joined
May 15, 2017
Messages
40
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