473,385 Members | 1,356 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to run a public module? and how do I obtain attributes from it?

Public modules are always something I have yet to get a hold of.

How do I runa public module, and how do I obtain attributes (such as username) from it?

** Edit **
This question was split away from thread Running VBA code when a user closes database using (x).
Mar 11 '11 #1
1 1424
NeoPa
32,556 Expert Mod 16PB
There's really no such thing as a Public Module.

There are three main module types in an Access project :
  1. Object Modules - Associated with form or report objects.
  2. Class Modules - Define a class that can be used elsewhere in your project.
  3. Standard Modules - Not associated with anything in particular. Procedures, variables and other items in this type of module can be accessed from other areas of the project as long as they are defined as Public.

Variables, Constants, Function Procedures and Subroutine Procedures can all be defined as either Local, Private or Public. Local items are accessible only from the procedure within which they are defined. A standard Dim within a procedure defines Local items. Private items are only accessible from the same module. This is true of all of the types of module. Public items, on the other hand, are accessible across the whole project.

For something to be easily accessible to the whole project it should be defined as Public in a Standard Module. This is because any class or object reference would treat the item as a property of an instance of the related class or object and therefore couldn't be referenced as easily as simply specifying the name. It may be easier to conceptualise if you were to consider Standard Modules as being associated with the overall project itself, whereas the other types are associated with their own specific object, thus cannot be accessed independently.

I hope that clarifies the situation for you.
Mar 11 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Elbert Lev | last post by:
Hi, all! In accordance with Python documentation, there are 2 ways to hide data/methods inside the module (make them private): 1. have "public" members defined in __all__ list 2. start...
2
by: Ashish Shridharan | last post by:
Hi All I have been tryign to figure out the scope of a module as shown declared below in a web environment. My Questions are Is this module shared across multiple instances of the...
2
by: Ryan McLean | last post by:
Hello everyone! I will describe what I am trying to accomplish, then the problem I am having. I am storing database passwords in the appSettings node of the web.config file. In the...
5
by: sophie_newbie | last post by:
OK this might seem like a retarded question, but what is the difference between a library and a module? If I do: import string am I importing a module or a library? And if i do...
9
by: Rudy | last post by:
Hello All! I'm a little confused on Public Class or Modules. Say I have a this on form "A" Public Sub Subtract() Dim Invoice As Decimal Dim Wage As Decimal Static PO As Decimal Invoice =...
5
by: Kimmo Laine | last post by:
Hi is there a way to change propertys attribute from the code? Letīs say that i have the following property in my class: public int Count } Is there a way to change the displayname, from...
6
by: Jakub.Bednarczuk | last post by:
Hallo everybody I have the problem with getting attributes values and also attributes names. I am reading an xml file with DOM. Lets see an example: file I read <root> <Def></Def>...
4
by: Ron Adam | last post by:
This is for a new version of pydoc if I can get the class attributes sorted out. The module level attributes aren't too difficult to categorize. (I might be just too tired to see the obvious.) ...
4
by: =?Utf-8?B?TWlrZQ==?= | last post by:
Hi. I'm trying to create a Public Module in a VB.NET/ASP.NET application. When coding the module I don't get real-time error checking/intellisense from Visual Studio. Basically I can type...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.