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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Access Modules

Status
Not open for further replies.

iamchemist

Programmer
Mar 2, 2009
73
US
Another newbie question that I would welcome some help with.

How does one access (i.e., run) an Access Module? Do you directly run the Module, or do you run a subroutine inside the Module? What does the actual VBA command look like to access a Module or part of a Module?

Thanks for the help,

Ron
 
You don't run Modules, you run Functions or Subroutines that are inside modules. And if you want to call a subroutine/function from outside the module, you must declare it as Public (as opposed to Private).

There are a number of places where you could call the sub/function:

From a Macro
From a Form (write code in some event, like a button click)
From the VBA Immediate window, type the name of the subroutine and press OK
 
Hi JoeAtWork,

Thanks a lot for your reply. You have at least given this newbie a path to follow up.

Ron
 

And remember the cardinal rule of these things:

Never, ever, give a module the same name as a function/sub within it!

This totally confuses the Access Gnomes!

The Missinglinq

Richmond, Virginia

There's ALWAYS more than one way to skin a cat!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top