?Link to enternal modules?

M

Mark

Can a function, located in a Module in a different .mdb
be linked or called from another .mdb? If so, how?

e.g.
MydatabaseB contains a Module that has function
called ABC().

1) Can queries in MydatabaseA call ABC()? syntax?

2) Can Modules/routines in MydatabaseA call ABC()? syntax?


TIA,
Mark
 
D

Dirk Goldgar

Mark said:
Can a function, located in a Module in a different .mdb
be linked or called from another .mdb? If so, how?

e.g.
MydatabaseB contains a Module that has function
called ABC().

1) Can queries in MydatabaseA call ABC()? syntax?

2) Can Modules/routines in MydatabaseA call ABC()? syntax?

Yes, and yes, but you have to set a reference to MyDatabaseB in your
project References. You can use the Tools -> References... dialog in
the VB Editor to do this. Then the syntax is just the same as that for
any user-written function. You do have to watch out for name
collisions; that is, having two procedures with the same name. I
believe that you can resolve such collisions by qualifying the procedure
name with the name of the VBA Project containing it, but I don't
remember exactly.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top