modules

  • Thread starter Thread starter Flowers of Scotland
  • Start date Start date
F

Flowers of Scotland

I have many modules in vb, i.e. a simple routine for msgbox with title and
vbcritical.

I always put it inside in each new application i make.

Is it it possibile to store it somewhere only once and to recall it? I have
also modules ofr searching department and so on... would be nnice to have
like a "perzonal.xls" in excel here in access.

tya
 
Flowers said:
I have many modules in vb, i.e. a simple routine for msgbox with title and
vbcritical.

I always put it inside in each new application i make.

Is it it possibile to store it somewhere only once and to recall it? I have
also modules ofr searching department and so on... would be nnice to have
like a "perzonal.xls" in excel here in access.


You can put your general purpose procedures in an mdb file
and then reference it as a library from your application
databases using Tools - References.
 
Flowers of Scotland said:
I have many modules in vb, i.e. a simple routine for msgbox with title and
vbcritical.

I always put it inside in each new application i make.

Is it it possibile to store it somewhere only once and to recall it? I
have also modules ofr searching department and so on... would be nnice to
have like a "perzonal.xls" in excel here in access.

tya

Make a new mdb file and import your module into it. Place it in its own
folder. Then open one of your apps that uses it, delete the module from the
app, then set a reference to the mdb you just built:

In the VBE, open the Tools menu and select 'References'. When the dialog
appears, click the 'Browse' button and change the 'Files of type' dropdown
to 'Microsoft Access Databases (*.mdb)'. Navigate to your mdb's folder and
select the file.

You now have a reference set to your own library file and all public
procedures/variables are available just as if the module still existed in
the app.
 
Stuart McCall said:
Make a new mdb file and import your module into it. Place it in its own
folder. Then open one of your apps that uses it, delete the module from
the app, then set a reference to the mdb you just built:

In the VBE, open the Tools menu and select 'References'. When the dialog
appears, click the 'Browse' button and change the 'Files of type' dropdown
to 'Microsoft Access Databases (*.mdb)'. Navigate to your mdb's folder and
select the file.

You now have a reference set to your own library file and all public
procedures/variables are available just as if the module still existed in
the app.
THAT'S COOOOOOOOOOOOOOOOOOL
Thanks
 
Evelyn Lang said:
THAT'S COOOOOOOOOOOOOOOOOOL
Thanks

A word of warning. When you're developing an app that uses a library file,
if an error should cause Access to break inside one of your library
procedures, you will find that you're able to make changes and debug 'on the
fly'. This is a great feature BUT there is one problem. When you either
close the current database or shut down Access, all changes made inside your
library file will be quietly lost. This is because Access only saves changes
to the current db project, it being the 'main' project opened in the editor.

The ability to debug/make changes/debug some more etc. while running your
app to do the testing is so useful that we need a way to work with it and
not have to re-create changes to the library. The way I do this is:

Copy all changed code and paste it into a notepad file.
Drop the current database and open the library file on its own.
Copy and paste the changes from the notepad file.
Save and compile etc.
 
Back
Top