By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,943 Members | 1,921 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,943 IT Pros & Developers. It's quick & easy.

Access an MDB file from another MDB file

P: n/a
Hi,
I have 2 MDB files (databases) in one folder - say A.mdb and B.mdb.
Database A.mdb has my tables and queries and macros. The forms are in
database B.mdb. I want to click a button on this form and run a macro
from database A.mdb. How do I do it ?

Thanks & Regards,
Amey Gupte
MS in Management Information Systems
Mays Business School
Texas A&M University.

Oct 30 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
am********@gmail.com wrote:
I want to click a button on this form and run a macro
from database A.mdb. How do I do it ?
Link to the tables in A.mdb (back end) from B.mdb (front end), giving these
linked table names the same names as the originals. Import the queries and
macros from A.mdb to B.mdb. In your button's click event paste this:

DoCmd.RunMacro "MacroName"

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200610/1

Oct 30 '06 #2

P: n/a
The following code will get you where you need:

Sub RunRemoteMacro()
Dim acc As New Access.Application
acc.OpenCurrentDatabase ("C:\Documents and Settings\User\My
Documents\db1.mdb")
'If you want to see the application, show this
' acc.Visible = True
acc.DoCmd.RunMacro "macro1"
acc.Quit
Set acc = Nothing
End Sub

You could put the code in the OnClick event of the button you want.
Chris Nebinger
am********@gmail.com wrote:
Hi,
I have 2 MDB files (databases) in one folder - say A.mdb and B.mdb.
Database A.mdb has my tables and queries and macros. The forms are in
database B.mdb. I want to click a button on this form and run a macro
from database A.mdb. How do I do it ?

Thanks & Regards,
Amey Gupte
MS in Management Information Systems
Mays Business School
Texas A&M University.
Oct 30 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.