Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Advice on Code in a Form or Module

Status
Not open for further replies.

cbuono

IS-IT--Management
Nov 11, 2001
11
US
I am working with coding VB directly in a form but it seems that in multiple procedures I am performing many of the same functions. I immediate thought that I should create a module that carries out these procedures and then just call the function in the code of my form. Basically Im wondering if I call the function from my form or code directly in my form will it add benefits?

Thanks in advance,
Chris
 
Hi:

From an intermediate programmer:

I believe that if you put the code in each form then the program must compile the code every time the form is needed.

If you put the code in a public module and call it from the form, then the code is compiled when the database is opened only, thus saving processing time.

Hope this helps. Gus Brunston [glasses] An old PICKer, using Access2000. I manage Suggestions welcome. padregus@attbi.com
 
Thanks Gus. I'll play with it a bit and see I get the results that I want.

Chris
 
Thanks Gus. I'll play with it a bit and see I get the results that I want.

Chris
 
I attempt to place most/all code in general modules, even if it uses form information. My rationale for this is to minimize the nummber of instances of "Like" code. You can always pass the form and or controls or values to the routine(s), to accomodate the variances betweeen instances of the procedure(s).

MichaelRed
m.red@att.net

There is never time to do it right but there is always time to do it over
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top