Control Database

iidx036

Registered User.
Local time
Today, 14:17
Joined
Sep 9, 2004
Messages
22
I would like to run VBA functions from other databases via a menu, a bit like a switchboard. For example, I have one module in database A that outputs a few spreadshseets - I would like a button on a form in Database B to run this.I have limited coding experience between databases so Could someone help me out?

TIA
 
Sorry to bump this up a bit - but I am struggling to achieve this can anyone point me in the right direction?

TIA
 
You can set a reference to a database file, and this might offer you the functionality you want. In a code window main menu navigate to Tools->References and click the browse button, and locate the database you want. Once this is done, all the objects in the referenced database should be available in the current database.
 
Tried that, however, it won't let me do it????? I thought I could achieve this via code - am I incorrect?

Cheers
 
Pretty sure you can do this using code, but you'll need to use ADO, or the similar

Code:
[COLOR=Green] ' If you can't dim it as a [I]New[/I] then change the following line with _
   Dim appAccess As Object _
   Set appAccess = CreateObject("Access.Application")[/COLOR]

    Dim appAccess As New Access.Application
    appAccess.OpenCurrentDatabase "C:\Folders\databaseName.mdb"
    appAccess.Run "ProjectName.FunctionName", .. optional parameters..

[COLOR=Green] ' appAccess.DoCmd.OpenModule "Module Name", "Function Name"[/COLOR]
 
Last edited:

Users who are viewing this thread

Back
Top Bottom