Using References in access

  • Thread starter Thread starter Oded Kovach
  • Start date Start date
O

Oded Kovach

Hello there

I have huge program in access. all in one mdb

Now i need to split it for many mdb/mde
and i have problem of that with cycle:

If i call from db1.mdb to db2.mdb by Referance i can't (as far as i know)
run function on db1 from db2

How can i use referances in this case?

any help would be useful
 
I am a little confuse about your question. In general splitting a database
involves having your application (code/forms/reports/queries/macros) in one
database and your tables/data in another.

Regardless of above if you need to call a function in another database it is
pretty straight forward by using the following approach:

Dim objAccess As Object

Set objAccess = GetObject(UNC_OR_PATH_TO_YOUR_REMOTE_DB)

Call ShowObjectWindow(objAccess)
Call objAccess.Run("YourFunctionName", YourArgument1, YourArgument2,
....)

Note that the function "YourFunctionName" should be defined as public in
your remote database. Also the function ShowObjectWindow is a set of API
calls to actually show the remote database. If you need an example of the
code please let me know.
 
Back
Top