How to reuse code in Access ? 
Author Message
 How to reuse code in Access ?

I would like to reuse same class and module in different Access
applications.
How can I do that ?

I know that I can import it, but it just a copy of code, not reference on
existing code.



Fri, 25 Feb 2005 00:55:59 GMT  
 How to reuse code in Access ?
Best way - is to make VB activex DLL - then you just add a reference to it
and can start using classes and functions

--
Alex Dybenko (MVP)
http://Alex.Dybenko.com


Quote:
> I would like to reuse same class and module in different Access
> applications.
> How can I do that ?

> I know that I can import it, but it just a copy of code, not reference on
> existing code.



Fri, 25 Feb 2005 03:30:53 GMT  
 How to reuse code in Access ?
You said it already: create a reference to another database to use its code.

--
Regards,
Bas Cost Budde, Holland
website at http://www.heuveltop.nl/BasCB/msac_index.html

Quote:

>I would like to reuse same class and module in different Access
>applications.
>How can I do that ?

>I know that I can import it, but it just a copy of code, not reference on
>existing code.



Fri, 25 Feb 2005 03:20:01 GMT  
 How to reuse code in Access ?

Quote:
>You said it already: create a reference to another database to use its code.

But (and this is all in A97)
1) an MDE can only reference another MDE and not an MDB.  
2) if you change the referenced MDE you must also ship the referencing
MDE even if you didn't make any changes in the referencing MDE
3) when programming in the MDB referencing an MDB and an error comes
up in the referenced MDB and you start making changes in the
referenced MDB they will be lost when you exit the code window ni the
reference MDB
4) if using an MDE addin you must use the RefLibPaths despite what the
online help says.

More info at my Addins Tips page at my website.

Tony
--
Tony Toews, Microsoft Access MVP
   Please respond only in the newsgroups so that others can
read the entire thread of messages.
   Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm



Sun, 27 Feb 2005 12:58:40 GMT  
 How to reuse code in Access ?

Quote:

>But (and this is all in A97)
>3) when programming in the MDB referencing an MDB and an error comes
>up in the referenced MDB and you start making changes in the
>referenced MDB they will be lost when you exit the code window ni the
>reference MDB

That certainly is a tough one! For the careless, sloppy, random anarchistic
type of developer I am <g>

Regards,
Bas Cost Budde, Holland
website at http://www.heuveltop.nl/BasCB/msac_index.html
Please post replies to the newsgroup so everyone can benefit



Sun, 27 Feb 2005 14:57:38 GMT  
 How to reuse code in Access ?
How does that work then Alex?
Can you just create a VB Project ActiveX DLL and copy VBA code into it?

--
Kahuna


Quote:
> Best way - is to make VB activex DLL - then you just add a reference to it
> and can start using classes and functions

> --
> Alex Dybenko (MVP)
> http://Alex.Dybenko.com



> > I would like to reuse same class and module in different Access
> > applications.
> > How can I do that ?

> > I know that I can import it, but it just a copy of code, not reference
on
> > existing code.



Tue, 01 Mar 2005 00:21:47 GMT  
 How to reuse code in Access ?
no
you have to create VB Project ActiveX DLL, add there public classes and
global multiuse classes for unctions, then compile it and add reference to
it from your access project

--
Alex Dybenko (MVP)
http://Alex.Dybenko.com


Quote:
> How does that work then Alex?
> Can you just create a VB Project ActiveX DLL and copy VBA code into it?

> --
> Kahuna



> > Best way - is to make VB activex DLL - then you just add a reference to
it
> > and can start using classes and functions

> > --
> > Alex Dybenko (MVP)
> > http://Alex.Dybenko.com



> > > I would like to reuse same class and module in different Access
> > > applications.
> > > How can I do that ?

> > > I know that I can import it, but it just a copy of code, not reference
> on
> > > existing code.



Wed, 02 Mar 2005 02:08:45 GMT  
 How to reuse code in Access ?

Quote:
>>3) when programming in the MDB referencing an MDB and an error comes
>>up in the referenced MDB and you start making changes in the
>>referenced MDB they will be lost when you exit the code window ni the
>>reference MDB
>That certainly is a tough one! For the careless, sloppy, random anarchistic
>type of developer I am <g>

Let me assure you that I'm aware of this problem the hard way.
<chuckle>

Tony
--
Tony Toews, Microsoft Access MVP
   Please respond only in the newsgroups so that others can
read the entire thread of messages.
   Microsoft Access Links, Hints, Tips & Accounting Systems at
http://www.granite.ab.ca/accsmstr.htm



Fri, 04 Mar 2005 13:29:03 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. How do I reuse code in the Code-Behind section of an ASPX page

2. Reuse of Code OCX?

3. Reuse code problem

4. Warning- careful when reusing code

5. Code ReUse Tip

6. Q: Regarding MDI and the reuse of controls and code

7. code reuse

8. Code Reuse

9. Reuse of VB3 code into VB5?

10. Reusing ActiveX Control/Code in Win GUI/MSIE

11. FYI: VBPJ's Policy on Code Reuse

12. Reuse code when interfaces implements the same method

 

 
Powered by phpBB® Forum Software