Trying to Understand Modules

  • Thread starter Thread starter DoveArrow
  • Start date Start date
D

DoveArrow

If I'm not mistaken, modules are the Visual Basic equivalent of
macros. However, I'm not sure how you create one, how you refer to
one, whether you can pass strings back and forth from a private
subroutine to a module, etc.

I'd really like to learn more about them, but I'm having a heck of a
time trying to find a good tutorial online. I've tried looking at the
Microsoft website, but when I've found that unless you already know
what they're talking about, it's next to impossible to understand what
they're talking about. Does anyone know of a good website that talks
about Modules in Idiot speak? Let me know. Thanks.
 
Modules are much much much more than macros. Forms and reports can
have modules and modules can exist in their own right too which is
probably what you are seeing and what you are asking about.
Modules contain instructions (code) to do what the designer wants.
They can decide what instructions to perform rather than just perform
a list of instructions as macros do.

Try this site. Although it isn't really in idiot speak, it does
present graded tips for Casual Users, Serious Users and Programmers
and much more. VBA (modules) is under 'Tips for Programmers'.
http://allenbrowne.com/tips.html

Others may have more sites.
--
Len
______________________________________________________
remove nothing for valid email address.
| If I'm not mistaken, modules are the Visual Basic equivalent of
| macros. However, I'm not sure how you create one, how you refer to
| one, whether you can pass strings back and forth from a private
| subroutine to a module, etc.
|
| I'd really like to learn more about them, but I'm having a heck of a
| time trying to find a good tutorial online. I've tried looking at the
| Microsoft website, but when I've found that unless you already know
| what they're talking about, it's next to impossible to understand what
| they're talking about. Does anyone know of a good website that talks
| about Modules in Idiot speak? Let me know. Thanks.
 
If I'm not mistaken, modules are the Visual Basic equivalent of
macros. However, I'm not sure how you create one, how you refer to
one, whether you can pass strings back and forth from a private
subroutine to a module, etc.

I'd really like to learn more about them, but I'm having a heck of a
time trying to find a good tutorial online. I've tried looking at the
Microsoft website, but when I've found that unless you already know
what they're talking about, it's next to impossible to understand what
they're talking about. Does anyone know of a good website that talks
about Modules in Idiot speak? Let me know. Thanks.

A Module is a container object for VBA code - usually one or more Sub or
Function procedures, typically related in function.

There are some good books about learning VBA. It's actually a dialect of the
older language Visual Basic, available in many incarnations. There are some
good references at:

Jeff Conrad's resources page:
http://www.accessmvp.com/JConrad/accessjunkie/resources.html

The Access Web resources page:
http://www.mvps.org/access/resources/index.html

Roger Carlson's tutorials, samples and tips:
http://www.rogersaccesslibrary.com/

A free tutorial written by Crystal:
http://allenbrowne.com/casu-22.html

A video how-to series by Crystal:
http://www.YouTube.com/user/LearnAccessByCrystal

MVP Allen Browne's tutorials:
http://allenbrowne.com/links.html#Tutorials

The first two references have books pages; my friend John Viescas wrote an
excellent book on learning VBA, and there are many others.
 
The most popular use of a module is an EVENT PROCEDURE, which responds to a
form event e.g. clicking a command button.
If you right click on a form button and choose 'Build Event' you can write
such a procedure. All event procedures for a form are contained in a single
form module. Event procedures can be anything from a single line of code to
hundreds of lines of code which read and update tables or display other
forms. The possibilities are endless...
The modules that you see under the modules tab are simply collections of
procedures or functions that are not specific to a form (although you could
call them from a forms module).
Good luck and remember the Access Help system is your greatest resource.
-- Dorian
"Give someone a fish and they eat for a day; teach someone to fish and they
eat for a lifetime".
 
Back
Top