Hy,
I have a database (Database2) which is referenced to an other database (Database1) so I can run macros from Database2 in Database1 just like this:
(I use it to open a form and run queries.)
So my problem is:
I need to run a macro in Database2 but the button which is activate the macro is on a Form in Database1. Unfortunatelly it seem referenced database is a one way method it don't works when I try:
All of the Google findigs are written to open the database then run the macro, but my database is open already so when i run it got errors.
For example:
When I tried to skip .OpenCurrentDatabase part of code i got errors.
Any ideas?
Thank You!
I have a database (Database2) which is referenced to an other database (Database1) so I can run macros from Database2 in Database1 just like this:
Code:
Database1.TestMacro
So my problem is:
I need to run a macro in Database2 but the button which is activate the macro is on a Form in Database1. Unfortunatelly it seem referenced database is a one way method it don't works when I try:
Code:
Database2.SecondMacro
All of the Google findigs are written to open the database then run the macro, but my database is open already so when i run it got errors.
For example:
Code:
Dim app As Access.Application
Set app = New Access.Application
With app
'.OpenCurrentDatabase "C:\AccesDB\Database2", True
.DoCmd.RunMacro "SecondMacro"
'.CloseCurrentDatabase
End With
When I tried to skip .OpenCurrentDatabase part of code i got errors.
Any ideas?
Thank You!