From: Trev B on
I have a function updateTables() in a a different db.

How do I run this remotely. In addition is it possible to pass parmeters

Regards
--
Trev B
From: Tom van Stiphout on
On Sat, 2 Jan 2010 08:31:01 -0800, Trev B
<TrevB(a)discussions.microsoft.com> wrote:

Yes you can. Here is an example:
In database 1:
Sub test()
Dim objAccess As New Access.Application
objAccess.OpenCurrentDatabase "c:\test\database2.accdb"
objAccess.Eval "Hello('aaa')"
End Sub

In database 2 in a standard module:
Public Function Hello(ByVal s As String)
MsgBox "Hello " & s
End Function

-Tom.
Microsoft Access MVP


>I have a function updateTables() in a a different db.
>
>How do I run this remotely. In addition is it possible to pass parmeters
>
>Regards
From: David W. Fenton on
Tom van Stiphout <tom7744.no.spam(a)cox.net> wrote in
news:u92vj55a0q19cb9n89gupeuui4gjd5kccu(a)4ax.com:

> Yes you can. Here is an example:
> In database 1:
> Sub test()
> Dim objAccess As New Access.Application
> objAccess.OpenCurrentDatabase "c:\test\database2.accdb"
> objAccess.Eval "Hello('aaa')"
> End Sub
>
> In database 2 in a standard module:
> Public Function Hello(ByVal s As String)
> MsgBox "Hello " & s
> End Function

Another option would be to use Application.Run:

Application.Run("c:\test\database2.Hello", "aaa")

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/