return function value from another DB?

J

Jim Burke in Novi

Can you return a function value from another database? I know how to call a
subroutine form another DB, as well as how to pass parameters, but am not
sure if there's any way of returning a value from a function. Any help is
appreciated.
 
C

Clifford Bass

Hi Jim,

In one database you might have:

Public Function MyFunction() As String

MyFunction = "Hello!"

End Function

And in another you might have:

Public Sub CallFnInOtherDB()

Dim appAccess As New Access.Application

With appAccess
.OpenCurrentDatabase "Miscellaneous Testing.mdb"
MsgBox appAccess.Run("MyFunction")
.CloseCurrentDatabase
End With

End Sub

Clifford Bass
 
J

Jim Burke in Novi

I didn't realize it was so simple. I was under the impression that once you
started the other appl, it had control until you closed it. Thanks.
 
C

Clifford Bass

Hi Jim,

You are welcome. Access and the other Office programs are all designed
to be controlled remotely as well as directly.

Clifford Bass
 

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