Re: Defining constant values: how to?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



on 11/11/2006 8:21 AM Douglas J. Steele wrote:
"mark s." <markseymour.89@xxxxxxxxxxxxxxxxxx> wrote in message news:Dpa5h.17470$cz.282223@xxxxxxxxxxxxxxxxxxxxxxxxxx
on 11/9/2006 10:27 PM Larry Linson wrote:
In the General, Declarations section of a standard module (for application-wide accessibility) use a statement such as:

Public Const AppName As String = "The Application Name"


Thanks :) So how do I refrence these in the form code to use it?

Right now the code is:

Me.Caption = AppName _
& " " & AppVersion

and it is not working.

What does "not working" mean? Are you getting an error? If so, what's the error? Is the caption being set to something other than what you expected? If so, are you sure that the constants are set correctly? Are you sure you put the declarations into a standard module, as opposed to the module associated with a form, or a class module?


Okay, It's working; I wasn't just looking at the caption. ^_^;

Now I want to use those set constants in form controls (like a label, text box, listbox etc.). But I do not know how to output it in the standard module (Not a class module, because I know that you can't use "Public Const" from looking at the help file on it.)
.