Solved

Standard Declaration Module

Posted on 2011-02-13
6
1,113 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 - Access MVP) earned 200 total points
ID: 34884298
See the images below.

mx
Capture1.gif
Capture2.gif
0
 
LVL 75

Assisted Solution

by:DatabaseMX (Joe Anderson - Access MVP)
DatabaseMX (Joe Anderson - Access MVP) 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
Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

 
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

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Most if not all databases provide tools to filter data; even simple mail-merge programs might offer basic filtering capabilities. This is so important that, although Access has many built-in features to help the user in this task, developers often n…
In Debugging – Part 1, you learned the basics of the debugging process. You learned how to avoid bugs, as well as how to utilize the Immediate window in the debugging process. This article takes things to the next level by showing you how you can us…
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
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 …

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now