Re: Public Variables

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




"Pierre de Beer" <pierre@xxxxxxxxxxxxxxx> wrote in message
news:OydmrzHOGHA.3924@xxxxxxxxxxxxxxxxxxxxxxx
Hi

I store the company name that is displayed on all my forms in a table. I
use
DLookup("[Company Name]", " Company Details") to retrieve the company name
from this table. Is it not better to retrieve the company name at startup
and store it to a global variable?

If the variable option is the best, how do I declare a global variable in
Access? I declare the variable in a module but can not get a value
assigned
to it.

As you can see I am new at this.

Kind Regards

Pierre



From what you describe, that sounds like a good candidate for a public
constant.

At the top of a module (not a form or report module):

Public Const CompanyName As String = "My Company Name"

I use this technique for version information that I want to appear on all of
my forms. Just change it in one place when necessary.

--
Randy Harris
tech at promail dot com
I'm pretty sure I know everything that I can remember.

.



Relevant Pages

  • Re: vb.net class
    ... about fixed array lenghts or using ReDim statements. ... code ensures everything in the array is a String because you declare it ... Count can be generated from the time list, not need to store ...
    (microsoft.public.dotnet.languages.vb)
  • Retrieving settings from Web.config
    ... exactly I want to store some connection ... Now how can I retrieve this connation string value in my application? ...
    (microsoft.public.dotnet.framework.aspnet)
  • REQ help with BETWEEN on hour int column
    ... I read somewhere years ago that it's best to store dates with no ... DECLARE @startHour INT; ... WHERE (myDate BETWEEN '8/21/2004' AND '8/25/2004') ...
    (microsoft.public.sqlserver.programming)
  • Insert and Selectin same SP
    ... One of them is: Choose the Store ... declare @QuestionIDas int ... declare @ViewOrder as int ... declare @OptionTextboxMode as nvarchar ...
    (microsoft.public.sqlserver.programming)
  • Re: Hide some columns of listview
    ... I don´t like to store things in the Tag property because it is not clear ... declare a separate class anyway to hold the data it is ...
    (microsoft.public.dotnet.languages.vb)