TheSwamp
Code Red => VB(A) => Topic started by: krampaul82 on October 23, 2008, 03:06:07 PM
-
:realmad:
To whom it may concern,
The following code does what it is suppost to for the first 2 case statements GT-116 PD and GT-116 PC but fails to work for the next two case statements GT-116 PB and GT-116 PA.
It will warn the user to pick a horizontal or vertical duct mount position (see code)
any help would be appreciated.
Mark
VBA code start
Private Sub cmd_sensor_gt_116_p_Click()
'ComboBox_gt_116_p Dropdown Menu
ComboBox_gt_116_p.Style = fmStyleDropDownList
'Get ComboBox_gt_116_p Dropdown Menu user pick
Select Case ComboBox_gt_116_p.Text
Case "GT 116-PD" 'Calls sub from Module_ebtron_sensors
If Opt1_gt_116_horiz = True Then
'Gets the Horizontal block
Sensor_gt_116_pd_horizontal_get
End If
If Opt2_gt_116_vert = True Then
'Gets the Vertical block
Sensor_gt_116_pd_vertical_get
Else: pick_gt_116_position_warn
End If
Case "GT 116-PC" 'Calls sub from Module_ebtron_sensors
If Opt1_gt_116_horiz = True Then
'Gets the Horizontal block
Sensor_gt_116_pc_horizontal_get
End If
If Opt2_gt_116_vert = True Then
'Gets the Vertical block
Sensor_gt_116_pc_vertical_get
Else: pick_gt_116_position_warn
End If
Case "GT 116-PB" 'Calls sub from Module_ebtron_sensors
If Opt1_gt_116_horiz = True Then
'Gets the Horizontal block
Sensor_gt_116_pb_horizontal_get
End If
If Opt2_gt_116_vert = True Then
'Gets the Vertical block
Sensor_gt_116_pb_vertical_get
Else: pick_gt_116_position_warn
End If
Case "GT 116-PA" 'Calls sub from Module_ebtron_sensors
If Opt1_gt_116_horiz = True Then
'Gets the Horizontal block
Sensor_gt_116_pa_horizontal_get
End If
If Opt2_gt_116_vert = True Then
'Gets the Vertical block
Sensor_gt_116_pa_vertical_get
Else: pick_gt_116_position_warn
End If
End Select
End Sub
-
Mayber there's something wrong with one of these subs?
Sensor_gt_116_pa_horizontal_get
Sensor_gt_116_pb_horizontal_get
Sensor_gt_116_pa_vertical_get
Sensor_gt_116_pb_vertical_get
-
The modules that contain those subs are pretty much the same and will do what they are suppost to if run individually
-
There is something going wrong somewhere (obviously) posting a small part of a larger whole doesn't really help a lot in seeing what's going on. My sugestion would be to put a breakpoint in and step through the code with F8 so you can see what it (the code) is doing on a line by line basis.
-
My Problem was a hyphen placement in the combobox add item statement(see underlined). Once Removed, Problem solved..
Sub UserForm_Initialize()
'Combobox Ebtron Choices
ComboBox_gt_ht_st_fan.AddItem "GT 116-F" 'GT 116-F = 0 Case Selection
ComboBox_gt_ht_st_fan.AddItem "HT 104-F" 'HT 104-F = 1 Case Selection
ComboBox_gt_ht_st_fan.AddItem "ST 104-F" 'ST-104-F = 2 Case Selection
'ComboBox_gt_ht_st_fan First item static
ComboBox_gt_ht_st_fan.ListIndex = 0
ComboBox_gt_116_p.AddItem "GT 116-PD" 'GT 116-PD = 0 Case Selection
ComboBox_gt_116_p.AddItem "GT 116-PC" 'GT 116-PC = 1 Case Selection
ComboBox_gt_116_p.AddItem "GT-116-PB" 'GT 116-PB = 2 Case Selection
ComboBox_gt_116_p.AddItem "GT-116-PA" 'GT 116-PA = 3 Case Selection
'ComboBox_gt_116_p First item static
ComboBox_gt_116_p.ListIndex = 0
-
My Problem was a hyphen placement in the combobox add item statement(see underlined). Once Removed, Problem solved..
Well, now who's fault was that? :roll: :wink:
Glad you figured it out!
-
My Problem was a hyphen placement in the combobox add item statement(see underlined). Once Removed, Problem solved..
Well, now who's fault was that? :roll: :wink:
Glad you figured it out!
Thank You