This is the entire code for Storing info, and Retrieving Info
Private Sub Current_Bay_Number_Enter()
Dim i As Integer
For i = 0 To 19 Step 1
If Me.Controls("Q" & i).Value = -1 Then
Question_Value(Cu
rrent_Bay_Number.Value - 1, i) = 1
Else
Question_Value(Current_Bay_Number.Value - 1, i) = Me.Controls("Q" & i).Value
End If
Next
For i = 22 To 27 Step 1
If Me.Controls("Q" & i).Value = -1 Then
Question_Value(Current_Bay_Number.Value - 1, i) = 1
Else
Question_Value(Current_Bay_Number.Value - 1, i) = Me.Controls("Q" & i).Value
End If
Next
Call DataEntry
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Sub DataEntry()
Dim temp() As Integer
ReDim temp(ArraySize)
Dim i As Integer
For i = 0 To 19 Step 1
If Me.Controls("Q" & i).Value * (-1) <> 0 Then
'//CSA STANDARD
If i = 0 Then
temp(2) = temp(2) + Me.Controls("Q" & i).Value * (-1)
End If
'//CSA SPECIAL
If i = 1 Then
temp(3) = temp(3) + Me.Controls("Q" & i).Value * (-1)
End If
'//MINI RUPTER SWITCH
If i = 2 Then
temp(9) = temp(9) + Me.Controls("Q" & i).Value * (-1)
End If
'//ALDUTI SWITCH
If i = 3 Then
temp(9) = temp(9) + Me.Controls("Q" & i).Value * (-1)
End If
'//ACCESS PLATE INTERIOR
If i = 4 Then
temp(15) = temp(15) + Me.Controls("Q" & i).Value
temp(12) = temp(12) + Me.Controls("Q" & i).Value
End If
'//DOOR
If i = 5 Then
temp(10) = temp(10) + Me.Controls("Q" & i).Value
temp(17) = temp(17) + Me.Controls("Q" & i).Value
End If
'//PANEL(NON UTILITY)
If i = 6 Then
temp(10) = temp(10) + Me.Controls("Q" & i).Value
temp(12) = temp(12) + Me.Controls("Q" & i).Value
temp(17) = temp(17) + Me.Controls("Q" & i).Value
End If
'//SCREEN DOOR
If i = 7 Then
temp(15) = temp(15) + Me.Controls("Q" & i).Value
temp(12) = temp(12) + Me.Controls("Q" & i).Value
End If
'//SERVICE ENTRANCE
If i = 9 Then
temp(14) = temp(14) + Me.Controls("Q" & i).Value * (-1)
temp(16) = temp(16) + Me.Controls("Q" & i).Value * (-1)
End If
'//NUMBER OF HEATERS
If i = 10 Then
temp(18) = temp(18) + Me.Controls("Q" & i).Value
End If
'//VOLTAGE INDICATORS
If i = 12 Then
temp(20) = temp(20) + Me.Controls("Q" & i).Value
End If
'//FUSE REFILL
If i = 13 Then
temp(21) = temp(21) + Me.Controls("Q" & i).Value * (-1)
End If
'//INSTRUCTION LABEL - 1 PER LINEUP, NOT INCLUDED HERE
'//ACCESS PLATE EXTERIOR (USED TO BE PT CARIAGE)
If i = 14 Then
temp(10) = temp(10) + Me.Controls("Q" & i).Value
temp(12) = temp(12) + Me.Controls("Q" & i).Value
End If
'//SMD
If i = 15 Then
temp(26) = temp(26) + Me.Controls("Q" & i).Value * (-1)
temp(27) = temp(27) + Me.Controls("Q" & i).Value * (-1)
temp(29) = temp(29) + Me.Controls("Q" & i).Value * (-1)
End If
'//FUSE ABOVE SWITCH
If i = 16 Then
temp(23) = temp(23) + Me.Controls("Q" & i).Value * (-1)
End If
'//DOUBLE BREAK SWITCH
If i = 17 Then
temp(28) = temp(28) + Me.Controls("Q" & i).Value * (-1)
End If
'//46KV
If i = 18 Then
temp(9) = temp(9) * 3
temp(23) = temp(23) * 3
temp(29) = temp(29) * 3
End If
'//Instruction label and manual location
If i = 19 Then
temp(22) = temp(22) + Me.Controls("Q" & i).Value * (-1)
End If
End If
Next
For i = 22 To ControlCount Step 1
If Me.Controls("Q" & i).Value * (-1) <> 0 Then
'//SERVICE ENTRANCE BAY
If i = 22 Then
temp(11) = temp(11) + Me.Controls("Q" & i).Value * (-1)
End If
'//LINE/LOAD SEPARATOR
If i = 23 Then
temp(7) = temp(7) + Me.Controls("Q" & i).Value * (-1)
temp(8) = temp(8) + Me.Controls("Q" & i).Value * (-1)
End If
'//TIE BAYS
If i = 24 Then
temp(16) = temp(16) + Me.Controls("Q" & i).Value * (-1)
End If
'//WIRE TROUGH
If i = 25 Then
temp(33) = temp(33) + Me.Controls("Q" & i).Value * (-1)
'Bays(Current_Bay_Number.Value - 1, 33) = Bays(Current_Bay_Number.Value - 1, 33) + Me.Controls("Q" & i).Value * (-1)
End If
'//INCOMER
If i = 26 Then
temp(16) = temp(16) + Me.Controls("Q" & i).Value * (-1)
End If
'//# OF PANELS(UTILITY)
If i = 27 Then
temp(13) = temp(13) + Me.Controls("Q" & i).Value
temp(10) = temp(10) + Me.Controls("Q" & i).Value
temp(17) = temp(17) + Me.Controls("Q" & i).Value
End If
End If
Next
'//Storing bay information array into master array
For i = 0 To ArraySize Step 1
Bays(Current_Bay_Number.Value - 1, i) = temp(i)
Next
End Sub
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Private Sub current_bay_number_Change()
Dim i As Integer
For i = 0 To 19 Step 1
Me.Controls("Q" & i).Value = Question_Value(Current_Bay_Number.Value - 1, i)
If Me.Controls("Q" & i).Value = -1 Then
Me.Controls("Q" & i).Value = 1
End If
Next
For i = 22 To 27 Step 1
Me.Controls("Q" & i).Value = Question_Value(Current_Bay_Number.Value - 1, i)
If Me.Controls("Q" & i).Value = -1 Then
Me.Controls("Q" & i).Value = 1
End If
Next
'"SMD-2C FUSE" & "DOUBLE BREAK SWITCH" & "# OF DOORS" combo box is locked
Q15.Locked = True
Q17.Locked = True
End Sub