Please Explain

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

To Al

When is it neccessary to complie your code in Access

Whats the difference between code that is bound to a control and code that is a module all by itself

What are the benefits to having modules in applications


I hope I didn't ask dumb questions? Thanks In Advanced
 
Answers below inline:

--
Lynn Trapp
MS Access MVP
www.ltcomputerdesigns.com
Access Security: www.ltcomputerdesigns.com/Security.htm


kw_uh97 said:
To All

When is it neccessary to complie your code in Access?

I compile anytime I make a change to code and am about to run the
application. You can save yourself some headaches if you will make that a
habit.
Whats the difference between code that is bound to a control and code that
is a module all by itself?

The answer depends to a great extent on how you code it but, mainly, code
bound to a control is only accessible to that control while code in a module
is often, depending on scope, available most anywhere.
What are the benefits to having modules in applications?

Mostly, that it allows you to create code that will be called from multi
places in your application.
 
Manually compiling just lets you find some errors ahead of time and the code will run slightly faster the first time it's run.

If you don't manually compile, the VBA engine *will* compile it automatically the first time the code runs, which is why it is
slightly slower the first time.

Whether you do it manually or VBA does it automatically , running code *has* been complied.

Like Lynn said, compiling manually will let you catch some errors before they bite you later. I don't know anyone that writes code
regularly that doesn't manually compile first.

To make it easy, I customized the VBA editor tool bar and put the compile button right next to the save button. (Access 97 used to
have the button on the toolbar by default.) It just saves having to open the debug menu to click on compile. And besides, your mouse
is right there on the save button anyway. (I trust you do save *before* you run *any* code, don't you?)

My personal habit, is; compile - save - run. It's such a habit that I do it without even thinking.

Good luck.

--

Sco

M.L. "Sco" Scofield, MCSD, MCP, MSS, Access MVP, A+
Useful Metric Conversion #16 of 19: 2 monograms = 1 diagram
Miscellaneous Access and VB "stuff" at www.ScoBiz.com
 
Back
Top