Solved

Standard Declaration Module

Posted on 2011-02-13
6
1,117 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
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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 84

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 57

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

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

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

Introduction The Visual Basic for Applications (VBA) language is at the heart of every application that you write. It is your key to taking Access beyond the world of wizards into a world where anything is possible. This article introduces you to…
Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …

829 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