Option Explicit
Dim intTotalWeight As Long
Dim intTotalLength As Long
Dim intCounter As Integer
Private Sub cmdBox_Click()
'Add weight of car to total weight of train
intTotalWeight = intTotalWeight + 65000
'Add length of car to total weight of train
intTotalLength = intTotalLength + 55
'Count total number of cars
intCounter = intCounter + 1
'Display Results
lblNumber.Caption = intCounter
lblWeight.Caption = intTotalWeight
lblLength.Caption = intTotalLength
End Sub
Private Sub cmdCaboose_Click()
'Add weight of car to total weight of train
intTotalWeight = intTotalWeight + 48000
'Add length of car to total weight of train
intTotalLength = intTotalLength + 36
'Count total number of cars
intCounter = intCounter + 1
'Display Results
lblNumber.Caption = intCounter
lblWeight.Caption = intTotalWeight
lblLength.Caption = intTotalLength
End Sub
Private Sub cmdExit_Click()
End
End Sub
Private Sub cmdHopper_Click()
'Add weight of car to total weight of train
intTotalWeight = intTotalWeight + 51300
'Add length of car to total weight of train
intTotalLength = intTotalLength + 46
'Count total number of cars
intCounter = intCounter + 1
'Display Results
lblNumber.Caption = intCounter
lblWeight.Caption = intTotalWeight
lblLength.Caption = intTotalLength
End Sub
Private Sub cmdRefrig_Click()
'Add weight of car to total weight of train
intTotalWeight = intTotalWeight + 59400
'Add length of car to total weight of train
intTotalLength = intTotalLength + 39
'Count total number of cars
intCounter = intCounter + 1
'Display Results
lblNumber.Caption = intCounter
lblWeight.Caption = intTotalWeight
lblLength.Caption = intTotalLength
End Sub
Private Sub cmdTank_Click()
'Add weight of car to total weight of train
intTotalWeight = intTotalWeight + 45200
'Add length of car to total weight of train
intTotalLength = intTotalLength + 35
'Count total number of cars
intCounter = intCounter + 1
'Display Results
lblNumber.Caption = intCounter
lblWeight.Caption = intTotalWeight
lblLength.Caption = intTotalLength
End Sub