Array in Form Load Event doesn't work!
I have made a form and put 5 Combo Boxes in there.
In the Form Load event, I populated all those Combo Boxes with figures etc..
After that, I stated some arrays and then when I try to run it, it doesnt work. Message comes up saying "Expected Array".
Here is the code:
Private Sub Form_Load()
'Populate the Runway Combo Box
cboRwy.AddItem "Runway 10"
cboRwy.AddItem "Runway 28"
cboRwy.ListIndex = 0
'Populate the Flap Combo Box
cboFlap.AddItem "Flap 5"
cboFlap.AddItem "Flap 15"
cboFlap.ListIndex = 0
'Populate the Wind Combo Box
For W = -10 To 20
cboWind.AddItem (TW) & " Knots"
Next W
cboWind.ListIndex = 10
'Populate the Temperature Combo Box
For T = -10 To 40
cboTemp.AddItem (T)
Next T
cboTemp.ListIndex = 22
'Populate the QNH Combo Box
For Q = 980 To 1050
cboQnh.AddItem (Q)
Next Q
cboQnh.ListIndex = 30
'Populate the EAI Combo Box
cboEAI.AddItem "Anti Ice ON"
cboEAI.AddItem "Anti Ice OFF"
cboEAI.ListIndex = 0
A = -10
For f = 1 To 5
R10F5Array(0, f) = A
Debug.Print R10F5Array(0, f)
A = A + 5
Next
B = -10
For f = 1 To 11
R10F5Array(f, 0) = B
Debug.Print R10F5Array(f, 0)
B = B + 5
Next
'Populate the internal grid array
'for Rwy 10, Flap 5
R10F5Array(1, 1) = 18460
R10F5Array(1, 2) = 19200
R10F5Array(1, 3) = 19850
R10F5Array(1, 4) = 20320
R10F5Array(1, 5) = 20690
R10F5Array(2, 1) = 18350
R10F5Array(2, 2) = 19110
R10F5Array(2, 3) = 19750
R10F5Array(2, 4) = 20240
R10F5Array(2, 5) = 20630
R10F5Array(3, 1) = 18240
R10F5Array(3, 1) = 19020
R10F5Array(3, 1) = 19670
R10F5Array(3, 1) = 20150
R10F5Array(3, 1) = 20570
R10F5Array(4, 1) = 18120
R10F5Array(4, 1) = 18910
R10F5Array(4, 1) = 19570
R10F5Array(4, 1) = 20050
R10F5Array(4, 1) = 20490
etc..
End Sub
Do you know what the problem is?