Is there a reason why I cannot create a Global Const of type Enum ?
Code:
Public Enum EnvironmentStatus
DevelopmentEnvironment
TestEnvironment
ProductionEnvironment
End Enum
[B]Global Const g_EnvironmentStatus As EnvironmentStatus = DevelopmentEnvironment[/B]
Sub ConnectTables()
Dim db As DAO.Database, t As DAO.TableDef
Set db = CurrentDb
For Each t In db.TableDefs
If InStr(1, t.Connect, "CB.mdb") <> 0 Then
Select Case g_EnvironmentStatus
Case DevelopmentEnvironment
t.Connect = ";DATABASE=P:\DatabaseDevelopment\CB.mdb"
Case ProductionEnvironment
t.Connect = ";DATABASE=P:\CB_Live\CB.mdb"
Case TestEnvironment
t.Connect = ";DATABASE=P:\DatabaseTesting\CB.mdb"
End Select
t.RefreshLink
End If
Next
End Sub