Hi All,
I have a message on my UserForm that informs me my procedure is too large. The code below represents one of 60 variations and as you can see it
can be quite large. As you can deduce from the code, there is a left and a right which mirrors each other. The reason for this simplicity is so
I can easily edit and not lose my freedom when variations all called for. However, this is not possible and 99.9 per cent of the time the Left
mirrors right.
My question is this. Would having a line such as:
Me.ComboBox31.Value & Me.ComboBox61.Value = "HUBAC001"
reduce the code Or is there an easier method I can use and not get too complicated for maintenance.
Private Sub ComboBox53_Change()
Select Case Me.ComboBox4.Value
Case "4/100"
If ComboBox53.Value = "M12" And ComboBox3.Value = "C" And UCase$(ComboBox52) = "CONICAL" Then
Me.ComboBox31.Value = "HUBAC001" 'THE HUB REQUIRED L/H
Me.ComboBox61.Value = "HUBAC001" 'THE HUB REQUIRED R/H
Me.TextBox49.Value = Val(TextBox28.Value) * 4.725 'THIS IS WEIGHT OF HUB L/H
Me.TextBox90.Value = Val(TextBox83.Value) * 4.725 'THIS IS WEIGHT OF HUB R/H
Me.ComboBox32.Value = "BRNGA001" 'THE BEARING L/H
Me.ComboBox62.Value = "BRNGA001" 'THE BEARING R/H
Me.TextBox50.Value = Val(TextBox29.Value) * 0.097 'WEIGHT OF BEARING
Me.TextBox91.Value = Val(TextBox84.Value) * 0.097 'WEIGHT OF BEARING
Me.ComboBox33.Value = "NOT REQUIRED" 'STUB AXLE WASHER L/H
Me.ComboBox63.Value = "NOT REQUIRED" 'STUB AXLE WASHER R/H
Me.TextBox51.Value = Val(TextBox30.Value) * 0 'WEIGHT OF STUB AXLE WASHER
Me.TextBox92.Value = Val(TextBox85.Value) * 0 'WEIGHT OF STUB AXLE WASHER
Me.ComboBox34.Value = "NUTA002" 'THE AXLE NUT
Me.ComboBox64.Value = "NUTA002" 'AXLE NUT
Me.TextBox52.Value = Val(TextBox31.Value) * 0.05 'WEIGHT OF NUTA002
Me.TextBox93.Value = Val(TextBox86.Value) * 0.05 'WEIGHT OF NUTA002
Me.ComboBox35.Value = "510237" 'SPLIT PIN
Me.ComboBox65.Value = "510237" 'SPLIT PIN
Me.TextBox53.Value = Val(TextBox32.Value) * 0.01 'WEIGHT OF SPLIT PIN
Me.TextBox94.Value = Val(TextBox87.Value) * 0.01 'WEIGHT OF SPLIT PIN
Me.ComboBox36.Value = "HBCAP004" 'HUB CAP
Me.ComboBox66.Value = "HBCAP004" 'HUB CAP
Me.TextBox54.Value = Val(TextBox34.Value) * 0.04 'WEIGHT OF HUBCAP004
Me.TextBox95.Value = Val(TextBox89.Value) * 0.04 'WEIGHT OF HUBCAP004
Me.ComboBox37.Value = "NUTW001" 'THIS IS THE WHEEL NUT
Me.ComboBox67.Value = "NUTW001" 'THIS IS THE WHEEL NUT
Me.TextBox55.Value = Val(TextBox27.Value) * 0.025 'THIS IS WEIGHT OF NUTW001
Me.TextBox96.Value = Val(TextBox82.Value) * 0.025 'THIS IS WEIGHT OF NUTW001
End If
End Sub
Bookmarks