473,396 Members | 1,996 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,396 software developers and data experts.

Declaring Public Const - is that forbidden in the declarations section of a form module?

MLH
I have a form module that starts out something like this...

Option Compare Database 'Use database order for string comparisons
.....

Then there's a line like this in it...

Public Const MyVar = 0

Clicking Run, Compile gives rise to an error there. Am I not supposed
to use "Public Const" in the declarations section of a form module?
Nov 12 '05 #1
2 5451
MLH wrote:
I have a form module that starts out something like this...

Option Compare Database 'Use database order for string comparisons
....

Then there's a line like this in it...

Public Const MyVar = 0

Clicking Run, Compile gives rise to an error there. Am I not supposed
to use "Public Const" in the declarations section of a form module?


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

- From the Access Help topic "Const Statement"

".... In class modules [...] constants can only be private and their
visibility can't be changed using the Public keyword."

Class modules are aka form modules.

- --
MGFoster:::mgf
Oakland, CA (USA)
-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBP6qxwYechKqOuFEgEQISEACfc0pmUgpOOcLhLCTuGgk3z+ t8BtMAniYW
OqFYVm95e0KHtdFQywoT/3iN
=g8dS
-----END PGP SIGNATURE-----

Nov 12 '05 #2
I just tried it in Access 2000 and got the following error message:

"Constants, fixed length strings, arrays, user defined types and declare
statements not allowed as public members of object modules"

Seems self-explanatory.

"MLH" <CR**@NorthState.net> wrote in message
news:jv********************************@4ax.com...
I have a form module that starts out something like this...

Option Compare Database 'Use database order for string comparisons
....

Then there's a line like this in it...

Public Const MyVar = 0

Clicking Run, Compile gives rise to an error there. Am I not supposed
to use "Public Const" in the declarations section of a form module?

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: lou zion | last post by:
hi all, i've got a class that takes a parameterless function pointer as a parameter. i want to store that function pointer in a variable and i'm trying to figure out the syntax. i came up with...
14
by: lutorm | last post by:
Hi, I'm having a problem with a return statement being parsed to return a function (I think). Check here: template <typename T> class A {}; template <typename T> class maker_of_A { public:...
9
by: MLH | last post by:
Would the following work if placed in a form module rather than a global module? Declare Sub InternetCloseHandle Lib "wininet.dll" (ByVal hInet As Long)
4
by: Lucy | last post by:
In the Declarations section of a form's code module, what is the difference between the following: Dim Flag As Boolean Public Flag As Boolean Private Flag As Boolean Thanks!
3
by: jcrouse | last post by:
The syntax for a public variable seems to be "Public Shared name As type". How AND where do I put these in my AppMain (startup module) so the can be used by two different forms Thanks John
8
by: flamexx7 | last post by:
Can anybody tell me what is wrong with declaration of pointer p ? template<class Tclass Stack { struct Link { T* data; Link* next; Link(T* dat, Link* nxt) : data(dat), next(nxt) {} }* head;...
2
by: spam | last post by:
I found a bug??? with constants in csharp. Consider the following: internal static readonly int MAX_BUFFER_SIZE=8192; internal static readonly int...
4
by: Rui.Hu719 | last post by:
Hi, All: I read the following passage from a book: "There are three exceptions to the rule that headers should not contain definitions: classes, const objects whose value is known at compile...
1
by: Ilya N. Golubev | last post by:
There is already one function processing pointer values this way. And there may easily appear more, including wrappers for this function. For purposes of further discussion, consider simplified...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.