stupid question - call code

Lanason

Registered User.
Local time
Today, 18:50
Joined
Sep 12, 2003
Messages
258
this is basic I know but I have never done it

I have a piece of code I want to repeat many times
rather than enter in every files / form

how/ where do I store it and how do I call it

is it a module?
if so is public sub / public function the right way?

a quick over view of this would be great please -
 
I have a piece of code I want to repeat many times
rather than enter in every files / form

Sounds like a public Function --if it returns some value.
If it does not return a value, then a public Sub would seem ok.

It would reside in a Standard module.

See this info from Paul (BaldyWeb) for more
 
Last edited:
...how/ where do I store it and how do I call it...
My 2c, in general, if you are asking a question about code, show the code. Code speaks for itself, and then we can give you way more precise information.
hth
Mark
 
Once you put it in a module, you can use a button or event on the form to call it using

Call 'Name' in the on click event of the button, or any event that works for what your are trying to do.
 
2nd to Mark's 2c...

Can you explain what you are trying to do. In some cases it makes perfect sense to have a globally available piece of code. In others, having it inside a procedure (but keeping to a naming convention you fine useful) works better.
 

Users who are viewing this thread

Back
Top Bottom