Solved

Standard Declaration Module

Posted on 2011-02-13
6
1,123 Views
Last Modified: 2012-05-11
1. Where is the "Standard Declaration Module" in ms Access?

2. How do I get to the " "Standard Declaration Module" in ms Access?

3.How and where do I put the following code in the  "Standard Declaration Module" in ms Access?

Public gblnRegistered as Boolean
0
Comment
Question by:cssc1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 200 total points
ID: 34884298
See the images below.

mx
Capture1.gif
Capture2.gif
0
 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform)
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 200 total points
ID: 34884307
1) Each Module (regular or Form/Report) has a Declarations section

2) Create a New Module if necessary ... which will automatically put you in the Declarations section.
Otherwise, do as show in image 1 above.

3) See image 2 above.

mx
0
 
LVL 11

Assisted Solution

by:RgGray3
RgGray3 earned 100 total points
ID: 34884419
You would create a standard module   (Modules container, NEW)

Just start making your declarations...

Make them public as you have shown in your example...
They are available

Anything before the first Sub or function is the declarations section

For more information refer to scope in the help util
Understanding the lifetime of variables
Understanding Scope and visibility
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
LVL 85

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 100 total points
ID: 34884504
I think you're referring to the "General Declarations" section of a "Standard Module". I've added a screenshot that might be a bit more clear.

To create a module, you can either use the Database window as suggested earlier, or you can do it directly in the VBA Editor by clicking Insert - Module (or by right-clicking in the Project Explorer and selecting Insert - Module).
EE-GenDec.png
0
 
LVL 58

Assisted Solution

by:Jim Dettman (Microsoft MVP/ EE MVE)
Jim Dettman (Microsoft MVP/ EE MVE) earned 100 total points
ID: 34887347
<<1. Where is the "Standard Declaration Module" in ms Access?>>

  Just to add a bit, you have three basic types of modules:

1. A module attached to a form or report
2. A Standard module
3. A Class module.

  All can be accessed by the VBA editor window.   All have a declartions section at the top where you can declare variable (use a dim statement) and constants (use a const statement).

  Where and how you delcare something determines what can see that variable.  For example, when you declare a variable at the procedure level, only code in the procedure can see that vairable.   When you do it at module level, if declared with the keyword private, only code in that module can see the variable.  If you declare it as Public, then it can be see from any module.

HTH
JimD.
0
 

Author Closing Comment

by:cssc1
ID: 35003440
Thank you all!
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

729 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question