Example: Access Apps: A, B, C
Macros: 1,2 from A; 3 from B; 4,5,6 from C
So can a macro be written that calls 1,2,3,4,5,6?
Thank you.
Are you looking for shell to call a macro in another database. Sorry but I
don't understand
--
Wayne
Manchester, England.
1st create your new DB and place some "bits" on it form, table, etc. Then
create a macro in this new DB ( call it OpenNewForm)
You can use a number of way to open a DB from another DB but the simplest it
to use a Call Shell function. You need also to (once the other D Base is
open) open the other form, so many people (me included) will do a bit of a
cheat here and
use a macro (in the other D Base) - which is why I suggested making the new
OpenNewForm macro.
In the other (old) DB place a button on a form and place this behind the
OnClick event
Change the "button Name" to what it is 1st though ?
Private Sub Button Name_Click()
On Error GoTo ButtonName_Click_Err
Call Shell("""C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE""
""S:\MyDocuments\MyDataBase.mdb""/XOpenNewForm", 1)
ButtonName_Click_Exit:
Exit Sub
ButtonName _Click_Err:
MsgBox Error$
Resume ButtonName _Click_Exit
End Sub
Martin I am not sure how much you understood the above so sorry if you
already know this but maybe the explanaton will assist another forum member
if you already know this.
Ensure you leave all the """"""""" and ((((())))) and other stuff (just
change the names) where I have put them. For more information on these doa
search in this forum as some new users find them a problem.
To explain
Call Shell("""Location of new D Base"" ""Full path of new
DB""/XMacroName", 1)
To find the location of the D Base (could be C drive or on a server it will
be somewhere else) use the Start - Run - Browse and then look for the
programme (don't click the run option, after you have found it simply
Cut-N-paste it into your code). You can use the same method to find the path
of your MDB.
The macro will need to be stored in the other DataBase and called from the
code in your current (the one with this code) the X simply tell access it's
a macro ie. XMacroName (which why you should never start the name of a
macro with an X.
I have used C drive if you DB is on another drive change this is the shell
Hope this helps
I am in the office at the moment on a server system
I am working on C drive and calling the macro on the server (S drive)
Call Shell("""C:\Program Files\Microsoft Office\OFFICE11\MSACCESS.EXE""
""S:\MyDocuments\MyDataBase.mdb""/XOpenNewForm", 1)
Notice the C:\ and the S:\
Sorry for that - hope it is clear now
--
Wayne
Manchester, England.
You can use a RunApp action in a macro to run a macro in another Access
app. The Command Line argument is along these lines...
"C:\Program Files\Microsoft Office\Msaccess.exe"
"C:\YourFolder\OtherApp.mde" /x MacroName
--
Steve Schapel, Microsoft Access MVP
VBA has the ability to 'reference' VBA routines in other Access
applications, without loading a separate access application.
Anything you do in a macro can be done exactly the same way
in Access VBA - all of the macro commands are available - and
the data objects you would use in VBS or VB6 are also available
as well.
(david)
"Martin" <Mar...@discussions.microsoft.com> wrote in message
news:80C169B5-FA64-4B11...@microsoft.com...