Problems with array in module (Access '97)



Hi,

I'm having some troubles using a string array in a module in VBA. I can
dimension the string array but am unable to set the variables equal to a
constant within the module (Really needs to be in the module). Actual code
(all two lines of it) is near the end.

When I try to set strStep1(1) = "Description" by using 'Set' or 'Let'
it gives an error (Invalid outside procedure), and when I try using 'Const'
declaration, an error is generated when the program gets to the
parenthesis.

Public strStep1(10) As String

Set strStep1(1) = "Description" 'Invalid outside procedure
-or-
Public Const strStep(1) as string = "Description" 'Gets to '(' and expects
'As' or '='

Any help would be appreciated, post back if clarification is needed.

Thanks,

Nick
.



Relevant Pages

  • Re: "Open Browser Window And Select A File"
    ... I haven't been able to do this in VBA yet. ... and separate each file name into an element of the string array, ... I have a code that opens a browser window and also record all the file ...
    (microsoft.public.excel.programming)
  • Re: Init. Multi-dimensional String Arrays VB vs. VBA
    ... I'm having a little syntax nightmare. ... I am trying to initialize a small 2-dimensional string array in VBA 6.5 ...
    (microsoft.public.word.vba.general)
  • Re: Problems with array in module (Access 97)
    ... >I'm having some troubles using a string array in a module in VBA. ... >dimension the string array but am unable to set the variables equal to a ... Public Sub InitArray() ...
    (microsoft.public.access.modulesdaovba)
  • Re: Init. Multi-dimensional String Arrays VB vs. VBA
    ... I thought VBA was a working subset of VB (without the ... As a macro language, ... I am trying to initialize a small 2-dimensional string array in VBA 6.5 ...
    (microsoft.public.word.vba.general)