Hi.
I am trying to create a global public array. I created a module called "GlobalVariables". In that Module I have this code..
Code:
Option Explicit
Public ELEMENTS_QUERIES As string
ELEMENTS_QUERIES = Array("2d1) Gate to Business Element", "2d2) Gate to Core Element", "2d3c) Gate to Cost Element", "2d4) Gate to Feature Element", _
"2d5) Gate to Perf Element", "2d6) Gate to Budget Element", "2d7) Gate to Sched Element")
On compile, I get error "Compiler Error: Invalid outside procedure" - it highlights the first string in the array - "2d1) Gate to Business Element"
I tried this also..
Code:
Option Explicit
Public ELEMENTS_QUERIES(1 To 7) As String
ELEMENTS_QUERIES(1) = "2d1) Gate to Business Element - Qry"
ELEMENTS_QUERIES(2) = "2d2) Gate to Core Element - Qry"
ELEMENTS_QUERIES(3) = "2d3) Gate to Cost Element - Qry"
ELEMENTS_QUERIES(4) = "2d4) Gate to Feature Element - Qry"
ELEMENTS_QUERIES(5) = "2d5) Gate to Perf Element - Qry"
ELEMENTS_QUERIES(6) = "2d6) Gate to Budget Element - Qry"
ELEMENTS_QUERIES(7) = "2d7) Gate to Sched Element - Qry"
I also tried this...
Code:
Option Explicit
Public ELEMENTS_QUERIES As String
Public Function Set_Global_Variables()
ELEMENTS_QUERIES = Array("2d1) Gate to Business Element", "2d2) Gate to Core Element", "2d3c) Gate to Cost Element", "2d4) Gate to Feature Element", _
"2d5) Gate to Perf Element", "2d6) Gate to Budget Element", "2d7) Gate to Sched Element")
End Function
I get the same error.
How can I create an populate a global array???
Thanks.
Steve
Harrisburg, PA USA