Custom Addin calling another custom Addin 
Author Message
 Custom Addin calling another custom Addin

I have several custom Addins I built in Access97.  I want to navigate
between these addins.  From a form of one Addin, how can I open a form of
another addin like you would by opening the second addin from the Addin
Menu?

Thanks.

George Padvorac



Tue, 21 Aug 2001 03:00:00 GMT  
 Custom Addin calling another custom Addin
Hi george,
You have a public procedure in the second add-in which you then call from
the first add-in.
Quote:

>I have several custom Addins I built in Access97.  I want to navigate
>between these addins.  From a form of one Addin, how can I open a form of
>another addin like you would by opening the second addin from the Addin
>Menu?

>Thanks.

>George Padvorac




Tue, 21 Aug 2001 03:00:00 GMT  
 Custom Addin calling another custom Addin
George,

This seems to be undocumented, but AFAIKR several days ago Michael Kaplan
wrote about this trick in one of the microsoft.public.access.* newsgroups,
namely he showed how Run is used to call autodialer in utility.mda:

    Application.Run "utility.wlib_AutoDial", "<PhoneNumberHere>"

The same trick can be used to solve (?) the subject:

- in xyz.mdb write code:

Public Sub frm123Open()
  Application.Run "123.frm123Open"
End Sub

- in 123.mda create form frm123 and write code:

Public Sub frm123Open()
  DoCmd.OpenForm "frm123"
End Sub

Create button [cmdOpenBingo] on frm123 and write the code to process its
Click event:

Private Sub cmdOpenBingo_Click()
  Application.Run "Bingo.frmBingGoOpen"
End Sub

- in Bingo.mda create form frmBingo and write code:

Public Sub frmBingGoOpen()
  DoCmd.OpenForm "frmBingo"
End Sub

- copy 123.mda and Bingo.mda to the directory defined by the following
Registry Value:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\8.0\Access\Wizards]
"AddInPath"="<Your path here>"

Be careful with CurrentDB() refs in your .MDAs - probably you will have to
change them to CodeDB()...

This is an interesting technique with a lot of other possible tricks which
can be coded based on it but probably it's too tricky to be used in real
apps/add-ins...

 What can you say about that, Michael?

HTH,
Shamil


Quote:
>OK, but how do I call the addin form so it opens up in the current mdb just
>like regular addins do?  for example:

>I'm working in XYZ.mdb and am using a form, frm123 from an addin called
>123.mda.  And I want to open a form called frmBingo from an addin called
>Bingo.mda.

>Thanks.



Wed, 22 Aug 2001 03:00:00 GMT  
 Custom Addin calling another custom Addin
This is only guaranteed to work for Microsoft Access Wizards (in 97 it will
work with other files if project name = file name sans extension and if the
file is placed in the Access dir... in Access 2000 it will not work at all
with anything but wizards).

I would recommend setting a reference to addin B inside of addin A if you
need A to call B. That is really the only supported way of doing things here
(and the only way that will work in future versions).

Michael


Quote:
> George,

> This seems to be undocumented, but AFAIKR several days ago Michael Kaplan
> wrote about this trick in one of the microsoft.public.access.* newsgroups,
> namely he showed how Run is used to call autodialer in utility.mda:

>     Application.Run "utility.wlib_AutoDial", "<PhoneNumberHere>"

> The same trick can be used to solve (?) the subject:

> - in xyz.mdb write code:

> Public Sub frm123Open()
>   Application.Run "123.frm123Open"
> End Sub

> - in 123.mda create form frm123 and write code:

> Public Sub frm123Open()
>   DoCmd.OpenForm "frm123"
> End Sub

> Create button [cmdOpenBingo] on frm123 and write the code to process its
> Click event:

> Private Sub cmdOpenBingo_Click()
>   Application.Run "Bingo.frmBingGoOpen"
> End Sub

> - in Bingo.mda create form frmBingo and write code:

> Public Sub frmBingGoOpen()
>   DoCmd.OpenForm "frmBingo"
> End Sub

> - copy 123.mda and Bingo.mda to the directory defined by the following
> Registry Value:

> [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\8.0\Access\Wizards]
> "AddInPath"="<Your path here>"

> Be careful with CurrentDB() refs in your .MDAs - probably you will have to
> change them to CodeDB()...

> This is an interesting technique with a lot of other possible tricks which
> can be coded based on it but probably it's too tricky to be used in real
> apps/add-ins...

>  What can you say about that, Michael?

> HTH,
> Shamil



> >OK, but how do I call the addin form so it opens up in the current mdb
just
> >like regular addins do?  for example:

> >I'm working in XYZ.mdb and am using a form, frm123 from an addin called
> >123.mda.  And I want to open a form called frmBingo from an addin called
> >Bingo.mda.

> >Thanks.



Wed, 22 Aug 2001 03:00:00 GMT  
 Custom Addin calling another custom Addin
OK, but how do I call the addin form so it opens up in the current mdb just
like regular addins do?  for example:

I'm working in XYZ.mdb and am using a form, frm123 from an addin called
123.mda.  And I want to open a form called frmBingo from an addin called
Bingo.mda.

Thanks.

Quote:

>Hi george,
>You have a public procedure in the second add-in which you then call from
>the first add-in.


>>I have several custom Addins I built in Access97.  I want to navigate
>>between these addins.  From a form of one Addin, how can I open a form of
>>another addin like you would by opening the second addin from the Addin
>>Menu?

>>Thanks.

>>George Padvorac




Thu, 23 Aug 2001 03:00:00 GMT  
 Custom Addin calling another custom Addin
No... you go to Tools|References and set a ref to the file.

Michael


Quote:
> Thanks for the input everybody!

> So whats the proper way to set the reference your'e talking about?

>     set myApp = "path\appB"

>     docmd.openform "myApp.frmName"

> or

>     Application.Run "appB.OpenFormProcedure"

> Like that?


> >This is only guaranteed to work for Microsoft Access Wizards (in 97 it
will
> >work with other files if project name = file name sans extension and if
the
> >file is placed in the Access dir... in Access 2000 it will not work at
all
> >with anything but wizards).

> >I would recommend setting a reference to addin B inside of addin A if you
> >need A to call B. That is really the only supported way of doing things
> here
> >(and the only way that will work in future versions).

> >Michael



> >> George,

> >> This seems to be undocumented, but AFAIKR several days ago Michael
Kaplan
> >> wrote about this trick in one of the microsoft.public.access.*
> newsgroups,
> >> namely he showed how Run is used to call autodialer in utility.mda:

> >>     Application.Run "utility.wlib_AutoDial", "<PhoneNumberHere>"

> >> The same trick can be used to solve (?) the subject:

> >> - in xyz.mdb write code:

> >> Public Sub frm123Open()
> >>   Application.Run "123.frm123Open"
> >> End Sub

> >> - in 123.mda create form frm123 and write code:

> >> Public Sub frm123Open()
> >>   DoCmd.OpenForm "frm123"
> >> End Sub

> >> Create button [cmdOpenBingo] on frm123 and write the code to process
its
> >> Click event:

> >> Private Sub cmdOpenBingo_Click()
> >>   Application.Run "Bingo.frmBingGoOpen"
> >> End Sub

> >> - in Bingo.mda create form frmBingo and write code:

> >> Public Sub frmBingGoOpen()
> >>   DoCmd.OpenForm "frmBingo"
> >> End Sub

> >> - copy 123.mda and Bingo.mda to the directory defined by the following
> >> Registry Value:

> >> [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\8.0\Access\Wizards]
> >> "AddInPath"="<Your path here>"

> >> Be careful with CurrentDB() refs in your .MDAs - probably you will have
> to
> >> change them to CodeDB()...

> >> This is an interesting technique with a lot of other possible tricks
> which
> >> can be coded based on it but probably it's too tricky to be used in
real
> >> apps/add-ins...

> >>  What can you say about that, Michael?

> >> HTH,
> >> Shamil



> >> >OK, but how do I call the addin form so it opens up in the current mdb
> >just
> >> >like regular addins do?  for example:

> >> >I'm working in XYZ.mdb and am using a form, frm123 from an addin
called
> >> >123.mda.  And I want to open a form called frmBingo from an addin
called
> >> >Bingo.mda.

> >> >Thanks.



Thu, 23 Aug 2001 03:00:00 GMT  
 Custom Addin calling another custom Addin
Thanks for the input everybody!

So whats the proper way to set the reference your'e talking about?

    set myApp = "path\appB"

    docmd.openform "myApp.frmName"

or

    Application.Run "appB.OpenFormProcedure"

Like that?

Quote:

>This is only guaranteed to work for Microsoft Access Wizards (in 97 it will
>work with other files if project name = file name sans extension and if the
>file is placed in the Access dir... in Access 2000 it will not work at all
>with anything but wizards).

>I would recommend setting a reference to addin B inside of addin A if you
>need A to call B. That is really the only supported way of doing things
here
>(and the only way that will work in future versions).

>Michael



>> George,

>> This seems to be undocumented, but AFAIKR several days ago Michael Kaplan
>> wrote about this trick in one of the microsoft.public.access.*
newsgroups,
>> namely he showed how Run is used to call autodialer in utility.mda:

>>     Application.Run "utility.wlib_AutoDial", "<PhoneNumberHere>"

>> The same trick can be used to solve (?) the subject:

>> - in xyz.mdb write code:

>> Public Sub frm123Open()
>>   Application.Run "123.frm123Open"
>> End Sub

>> - in 123.mda create form frm123 and write code:

>> Public Sub frm123Open()
>>   DoCmd.OpenForm "frm123"
>> End Sub

>> Create button [cmdOpenBingo] on frm123 and write the code to process its
>> Click event:

>> Private Sub cmdOpenBingo_Click()
>>   Application.Run "Bingo.frmBingGoOpen"
>> End Sub

>> - in Bingo.mda create form frmBingo and write code:

>> Public Sub frmBingGoOpen()
>>   DoCmd.OpenForm "frmBingo"
>> End Sub

>> - copy 123.mda and Bingo.mda to the directory defined by the following
>> Registry Value:

>> [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\8.0\Access\Wizards]
>> "AddInPath"="<Your path here>"

>> Be careful with CurrentDB() refs in your .MDAs - probably you will have
to
>> change them to CodeDB()...

>> This is an interesting technique with a lot of other possible tricks
which
>> can be coded based on it but probably it's too tricky to be used in real
>> apps/add-ins...

>>  What can you say about that, Michael?

>> HTH,
>> Shamil



>> >OK, but how do I call the addin form so it opens up in the current mdb
>just
>> >like regular addins do?  for example:

>> >I'm working in XYZ.mdb and am using a form, frm123 from an addin called
>> >123.mda.  And I want to open a form called frmBingo from an addin called
>> >Bingo.mda.

>> >Thanks.



Fri, 24 Aug 2001 03:00:00 GMT  
 Custom Addin calling another custom Addin
OK, that may not be rocket science, but it was way cool.  It worked like a
champ first time!!!

Thanks.

Quote:

>No... you go to Tools|References and set a ref to the file.

>Michael



>> Thanks for the input everybody!

>> So whats the proper way to set the reference your'e talking about?

>>     set myApp = "path\appB"

>>     docmd.openform "myApp.frmName"

>> or

>>     Application.Run "appB.OpenFormProcedure"

>> Like that?


>> >This is only guaranteed to work for Microsoft Access Wizards (in 97 it
>will
>> >work with other files if project name = file name sans extension and if
>the
>> >file is placed in the Access dir... in Access 2000 it will not work at
>all
>> >with anything but wizards).

>> >I would recommend setting a reference to addin B inside of addin A if
you
>> >need A to call B. That is really the only supported way of doing things
>> here
>> >(and the only way that will work in future versions).

>> >Michael



>> >> George,

>> >> This seems to be undocumented, but AFAIKR several days ago Michael
>Kaplan
>> >> wrote about this trick in one of the microsoft.public.access.*
>> newsgroups,
>> >> namely he showed how Run is used to call autodialer in utility.mda:

>> >>     Application.Run "utility.wlib_AutoDial", "<PhoneNumberHere>"

>> >> The same trick can be used to solve (?) the subject:

>> >> - in xyz.mdb write code:

>> >> Public Sub frm123Open()
>> >>   Application.Run "123.frm123Open"
>> >> End Sub

>> >> - in 123.mda create form frm123 and write code:

>> >> Public Sub frm123Open()
>> >>   DoCmd.OpenForm "frm123"
>> >> End Sub

>> >> Create button [cmdOpenBingo] on frm123 and write the code to process
>its
>> >> Click event:

>> >> Private Sub cmdOpenBingo_Click()
>> >>   Application.Run "Bingo.frmBingGoOpen"
>> >> End Sub

>> >> - in Bingo.mda create form frmBingo and write code:

>> >> Public Sub frmBingGoOpen()
>> >>   DoCmd.OpenForm "frmBingo"
>> >> End Sub

>> >> - copy 123.mda and Bingo.mda to the directory defined by the following
>> >> Registry Value:

>> >> [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\8.0\Access\Wizards]
>> >> "AddInPath"="<Your path here>"

>> >> Be careful with CurrentDB() refs in your .MDAs - probably you will
have
>> to
>> >> change them to CodeDB()...

>> >> This is an interesting technique with a lot of other possible tricks
>> which
>> >> can be coded based on it but probably it's too tricky to be used in
>real
>> >> apps/add-ins...

>> >>  What can you say about that, Michael?

>> >> HTH,
>> >> Shamil



>> >> >OK, but how do I call the addin form so it opens up in the current
mdb
>> >just
>> >> >like regular addins do?  for example:

>> >> >I'm working in XYZ.mdb and am using a form, frm123 from an addin
>called
>> >> >123.mda.  And I want to open a form called frmBingo from an addin
>called
>> >> >Bingo.mda.

>> >> >Thanks.



Fri, 24 Aug 2001 03:00:00 GMT  
 Custom Addin calling another custom Addin
Well, you have now changed the requirements quite a bit. Your original
statement never even hinted that you needed each add-in to be able to call
the other.

Rather then solve your problems one at a time, could you just list all the
things you need to be able to do? Then maybe we can all figure out how to do
what you need?

Michael


Quote:
> OK, I opened addin "B" by calling it from addin "A" as you recommended.
But
> now "B" was opened first and then I need to open addin "A".  When I set a
> reference to "A" from with in "B", I got an error MSG "You can't use a
> circular reference.

> When I made 2 tool bar buttons (one to open "A" and one to open "B"), I
> could open either addin first, but when I tried to open the second addin,
I
> got the error MSG:  "The expression you entered has a function name that
> Access can't find".

> Any more ideas or are we at the end of the road?


> >No... you go to Tools|References and set a ref to the file.

> >Michael



> >> Thanks for the input everybody!

> >> So whats the proper way to set the reference your'e talking about?

> >>     set myApp = "path\appB"

> >>     docmd.openform "myApp.frmName"

> >> or

> >>     Application.Run "appB.OpenFormProcedure"

> >> Like that?


> >> >This is only guaranteed to work for Microsoft Access Wizards (in 97 it
> >will
> >> >work with other files if project name = file name sans extension and
if
> >the
> >> >file is placed in the Access dir... in Access 2000 it will not work at
> >all
> >> >with anything but wizards).

> >> >I would recommend setting a reference to addin B inside of addin A if
> you
> >> >need A to call B. That is really the only supported way of doing
things
> >> here
> >> >(and the only way that will work in future versions).

> >> >Michael



> >> >> George,

> >> >> This seems to be undocumented, but AFAIKR several days ago Michael
> >Kaplan
> >> >> wrote about this trick in one of the microsoft.public.access.*
> >> newsgroups,
> >> >> namely he showed how Run is used to call autodialer in utility.mda:

> >> >>     Application.Run "utility.wlib_AutoDial", "<PhoneNumberHere>"

> >> >> The same trick can be used to solve (?) the subject:

> >> >> - in xyz.mdb write code:

> >> >> Public Sub frm123Open()
> >> >>   Application.Run "123.frm123Open"
> >> >> End Sub

> >> >> - in 123.mda create form frm123 and write code:

> >> >> Public Sub frm123Open()
> >> >>   DoCmd.OpenForm "frm123"
> >> >> End Sub

> >> >> Create button [cmdOpenBingo] on frm123 and write the code to process
> >its
> >> >> Click event:

> >> >> Private Sub cmdOpenBingo_Click()
> >> >>   Application.Run "Bingo.frmBingGoOpen"
> >> >> End Sub

> >> >> - in Bingo.mda create form frmBingo and write code:

> >> >> Public Sub frmBingGoOpen()
> >> >>   DoCmd.OpenForm "frmBingo"
> >> >> End Sub

> >> >> - copy 123.mda and Bingo.mda to the directory defined by the
following
> >> >> Registry Value:

> >> >> [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\8.0\Access\Wizards]
> >> >> "AddInPath"="<Your path here>"

> >> >> Be careful with CurrentDB() refs in your .MDAs - probably you will
> have
> >> to
> >> >> change them to CodeDB()...

> >> >> This is an interesting technique with a lot of other possible tricks
> >> which
> >> >> can be coded based on it but probably it's too tricky to be used in
> >real
> >> >> apps/add-ins...

> >> >>  What can you say about that, Michael?

> >> >> HTH,
> >> >> Shamil



> >> >> >OK, but how do I call the addin form so it opens up in the current
> mdb
> >> >just
> >> >> >like regular addins do?  for example:

> >> >> >I'm working in XYZ.mdb and am using a form, frm123 from an addin
> >called
> >> >> >123.mda.  And I want to open a form called frmBingo from an addin
> >called
> >> >> >Bingo.mda.

> >> >> >Thanks.



Fri, 24 Aug 2001 03:00:00 GMT  
 Custom Addin calling another custom Addin
OK, I opened addin "B" by calling it from addin "A" as you recommended. But
now "B" was opened first and then I need to open addin "A".  When I set a
reference to "A" from with in "B", I got an error MSG "You can't use a
circular reference.

When I made 2 tool bar buttons (one to open "A" and one to open "B"), I
could open either addin first, but when I tried to open the second addin, I
got the error MSG:  "The expression you entered has a function name that
Access can't find".

Any more ideas or are we at the end of the road?

Quote:

>No... you go to Tools|References and set a ref to the file.

>Michael



>> Thanks for the input everybody!

>> So whats the proper way to set the reference your'e talking about?

>>     set myApp = "path\appB"

>>     docmd.openform "myApp.frmName"

>> or

>>     Application.Run "appB.OpenFormProcedure"

>> Like that?


>> >This is only guaranteed to work for Microsoft Access Wizards (in 97 it
>will
>> >work with other files if project name = file name sans extension and if
>the
>> >file is placed in the Access dir... in Access 2000 it will not work at
>all
>> >with anything but wizards).

>> >I would recommend setting a reference to addin B inside of addin A if
you
>> >need A to call B. That is really the only supported way of doing things
>> here
>> >(and the only way that will work in future versions).

>> >Michael



>> >> George,

>> >> This seems to be undocumented, but AFAIKR several days ago Michael
>Kaplan
>> >> wrote about this trick in one of the microsoft.public.access.*
>> newsgroups,
>> >> namely he showed how Run is used to call autodialer in utility.mda:

>> >>     Application.Run "utility.wlib_AutoDial", "<PhoneNumberHere>"

>> >> The same trick can be used to solve (?) the subject:

>> >> - in xyz.mdb write code:

>> >> Public Sub frm123Open()
>> >>   Application.Run "123.frm123Open"
>> >> End Sub

>> >> - in 123.mda create form frm123 and write code:

>> >> Public Sub frm123Open()
>> >>   DoCmd.OpenForm "frm123"
>> >> End Sub

>> >> Create button [cmdOpenBingo] on frm123 and write the code to process
>its
>> >> Click event:

>> >> Private Sub cmdOpenBingo_Click()
>> >>   Application.Run "Bingo.frmBingGoOpen"
>> >> End Sub

>> >> - in Bingo.mda create form frmBingo and write code:

>> >> Public Sub frmBingGoOpen()
>> >>   DoCmd.OpenForm "frmBingo"
>> >> End Sub

>> >> - copy 123.mda and Bingo.mda to the directory defined by the following
>> >> Registry Value:

>> >> [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\8.0\Access\Wizards]
>> >> "AddInPath"="<Your path here>"

>> >> Be careful with CurrentDB() refs in your .MDAs - probably you will
have
>> to
>> >> change them to CodeDB()...

>> >> This is an interesting technique with a lot of other possible tricks
>> which
>> >> can be coded based on it but probably it's too tricky to be used in
>real
>> >> apps/add-ins...

>> >>  What can you say about that, Michael?

>> >> HTH,
>> >> Shamil



>> >> >OK, but how do I call the addin form so it opens up in the current
mdb
>> >just
>> >> >like regular addins do?  for example:

>> >> >I'm working in XYZ.mdb and am using a form, frm123 from an addin
>called
>> >> >123.mda.  And I want to open a form called frmBingo from an addin
>called
>> >> >Bingo.mda.

>> >> >Thanks.



Sat, 25 Aug 2001 03:00:00 GMT  
 
 [ 10 post ] 

 Relevant Pages 

1. COM Addin for Custom Property Page

2. custom toolbar through com addin in outlook

3. Excel addin and custom menu

4. Convert custom Addin from Access 97 to 2000

5. How do I get a VB5 AddIn DLL in the Addin Manager

6. Help: Need advise on turning VB Addin into Excel Addin

7. create custom icon,custom combobox in custom toolbar

8. create custom icon,custom combobox(to insert values)in custom toolbar

9. Calling sub in add-in from another addin?

10. Calling a macro in an AddIn

11. Calling a procedure which is in an AddIn

12. Invoking custom help file from a custom menu

 

 
Powered by phpBB® Forum Software