* My machine is Windows 2000 SP4
* Some users have XP SP?
* Both using Office 2003
I have 5 different databases for Facilities 1 thru 5 which are accessible by users from our Intranet website.
The owner is determined to reduce the number of clicks by having links that directly open a specific facility. She doesn't want to click a link then have to select a facility from a form.
The web page has a separate link for each facility database.
I would like to have each facility database open the same main database and pass to it the facility name. This will alleviate having to maintain 5 different sets of queries and reports for each.
So far I have been successful in autmating the main database, the problem I am having is passing or setting the variable in the main database with the facility name that is opening it. Can anyone explain the syntax for doing this?
Here is the code that I have for one of my Facility databases:
The variable is declared in the Main database inside a global module, here is the code.
Main database Code
Option Compare Database
Public MyVariable$
Facility database Code
Option Compare Database
Public Const EWPath = "C:\Documents and Settings\sjellert\Desktop\test-two.mdb"
Public Sub OpenEWmdb()
Set appAccess = CreateObject("Access.Application")
appAccess.OpenCurrentDatabase EWPath
appAccess.Set MyVariable$ = "Fac1" 'This is the problem Line
End Sub
Also tried:
Facility Database Code
Option Compare Database
Public Const EWPath = "C:\Documents and Settings\sjellert\Desktop\test-two.mdb"
Public Sub OpenEWmdb()
Set appAccess = CreateObject("Access.Application")
appAccess.OpenCurrentDatabase EWPath
appAccess.Set Module1.MyVariable$ = "Fac1" 'This is the problem Line
End Sub
Any help that you can provide is GREATLY appreciated.
Thanks,
SELLERT
If I'm not learning I must be coasting. If I am coasting I must be going down hill.
* Some users have XP SP?
* Both using Office 2003
I have 5 different databases for Facilities 1 thru 5 which are accessible by users from our Intranet website.
The owner is determined to reduce the number of clicks by having links that directly open a specific facility. She doesn't want to click a link then have to select a facility from a form.
The web page has a separate link for each facility database.
I would like to have each facility database open the same main database and pass to it the facility name. This will alleviate having to maintain 5 different sets of queries and reports for each.
So far I have been successful in autmating the main database, the problem I am having is passing or setting the variable in the main database with the facility name that is opening it. Can anyone explain the syntax for doing this?
Here is the code that I have for one of my Facility databases:
The variable is declared in the Main database inside a global module, here is the code.
Main database Code
Option Compare Database
Public MyVariable$
Facility database Code
Option Compare Database
Public Const EWPath = "C:\Documents and Settings\sjellert\Desktop\test-two.mdb"
Public Sub OpenEWmdb()
Set appAccess = CreateObject("Access.Application")
appAccess.OpenCurrentDatabase EWPath
appAccess.Set MyVariable$ = "Fac1" 'This is the problem Line
End Sub
Also tried:
Facility Database Code
Option Compare Database
Public Const EWPath = "C:\Documents and Settings\sjellert\Desktop\test-two.mdb"
Public Sub OpenEWmdb()
Set appAccess = CreateObject("Access.Application")
appAccess.OpenCurrentDatabase EWPath
appAccess.Set Module1.MyVariable$ = "Fac1" 'This is the problem Line
End Sub
Any help that you can provide is GREATLY appreciated.
Thanks,
SELLERT
If I'm not learning I must be coasting. If I am coasting I must be going down hill.