PDA

View Full Version : Startup templates referencing other Startup templates



jeeves
04-07-2005, 12:10 PM
So I'm customizing some existing code to work with a new startup template. I have everything working, thankfully.

I originally had it set up this way:

Template A - new startup template referenced Template B
Template B - existing template in Workgroup folder that contains a reference to Template C.
Template C - existing global template in Startup

I ran into a memory error that I thought I caused, and in an attempt to resolve it I moved the code i was calling in Template B to a module in Template A and referenced Template C.

So I now have it set up this way:
Template A - Startup template with a reference to Template C
Template C - Global Startup template

Can anyone foresee any problems with having startup templates reference one another? I'm not too sure about copyright with merging two vendors code into one template, although I retained the vendor information commented into the code.

BTW - the memory error I was troubleshooting turned out to reside in the original code, and not in my customizations, thank god!

MOS MASTER
04-07-2005, 01:34 PM
Can anyone foresee any problems with having startup templates reference one another?
Hi, :D

As far as I know, you cannot have cyclical references. Two VBA projects cannot reference each other. (at least not at design time)
Always give the project a unique project name to exclude errors with setting reference and stuff.
Check for Name convention: Check for doubles or names that are reserved by the application.
Compile each project and check for syntax ore other errors..etc?

So I now have it set up this way:
Template A - Startup template with a reference to Template C
Template C - Global Startup template
Looks pretty good but perhaps you could be on a more save side.

My favourite approach:

Round up all you?re functions and procedures in ONE template. (don?t matter if it?s global or not)
Then have you?re two ore more templates reference that ONE template instead of each other. It?s always a good idea to keep the amount off references down.
In you?re case you would create a template B and put al the generic (Functions and stuff) code in that template

Then Template A and C could set a reference to B

It?s a suggestion so if the current setup works for you?leave it! ;)


I'm not too sure about copyright with merging two vendors code into one template, although I retained the vendor information commented into the code.
Well this seams like the way a lot off people use other peoples stuff (if they give credits at all!)

If you know where you got the code from you could elaborate and ask for there permission on using there code. I think that would settle it?

Enjoy! :thumb

fumei
04-08-2005, 12:53 PM
Good advice MOS Master! Too many references is not a good idea. Consolidation into as few templates is also a good idea.

jeeves
04-08-2005, 05:45 PM
Thanks so much for the comments! I just wanted to get another opinion. I'll leave it as is, since it works and is two templates instead of one.

MOS MASTER
04-09-2005, 11:17 AM
Good advice MOS Master! Too many references is not a good idea. Consolidation into as few templates is also a good idea.Thanx Fumei! :thumb


Thanks so much for the comments! I just wanted to get another opinion. I'll leave it as is, since it works and is two templates instead of one.:beerchug: You're welcome and like I said if it works without havoks don't change it...but if you come to rebuild you're sollution...you know where the serpents are! :thumb