Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,564
- Office Version
- 365
- 2016
- Platform
- Windows
I have a form in my project. Very simple, one combobox. The user simply enters a value of 1-6. ENtering a valid value in the combobox closes the userform and code continues based on the information provided by the user.
When the user form closes, I am getting an error. Mircrosoft Forms Error: "Invalid property value"
Suppose I select "1" from the combox. It goes to routine "pop_Dsvc". I unload the userform at the top of this procedure with "Unload frm_select". No negative consequences resul in the rest of the application following this error to my knowledge. It just simply breaks the flow.
Here is the code associated with my form:
When the user form closes, I am getting an error. Mircrosoft Forms Error: "Invalid property value"
Suppose I select "1" from the combox. It goes to routine "pop_Dsvc". I unload the userform at the top of this procedure with "Unload frm_select". No negative consequences resul in the rest of the application following this error to my knowledge. It just simply breaks the flow.
Here is the code associated with my form:
VBA Code:
Private Sub ComboBox1_Change()
'Stop
If Not mbevents Then Exit Sub
ui1 = ComboBox1.Value
If ui1 = "1" Then
pop_Dsvc 'svcnum
ElseIf ui1 = "2" Then
pop_Fsvc 'svcnum
ElseIf ui1 = "3" Then
pop_Csvc 'svcnum
ElseIf ui1 = "4" Then
pop_Tsvc 'svcnum
ElseIf ui1 = "5" Then
pop_Psvc 'svcnum
ElseIf ui1 = "6" Then
selectAll
ElseIf ui1 = "7" Then
'Stop
With ws_front
Unload frm_select
.Shapes("ins_crewpkgs_output").Visible = True
.Shapes("ins_crewpkgs_output").OnAction = "crewpkgs1"
.Shapes("oos_crewpkgs_output").Visible = False
End With
Else
mbevents = False
combox1.Value = "6"
mbevents = True
End If
End Sub
Private Sub UserForm_Initialize()
mbevents = False
ComboBox1.Value = ""
mbevents = True
End Sub