return function value from another DB?

  • Thread starter Thread starter Jim Burke in Novi
  • Start date Start date
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.
 
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
 
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.
 
Hi Jim,

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

Clifford Bass
 
Back
Top