Hi all,
Was a member here many moons ago, since then I've avoided all desk based activity however I'm now back behind one of those retched things but have forgot everything
problem I am having is I get a runtime error 80010108 when I chose from a dropdown in a combobox it seems to work the first time fine but if I change the selection it errors out...must be an error in my code but I cant figure this out. below is my code (please don't judge me i know its not 'text book')
I believe the error must be due to something in here but cant figure out another way or what needs changing.
Any help is hugely appreciated
Lewie
Was a member here many moons ago, since then I've avoided all desk based activity however I'm now back behind one of those retched things but have forgot everything
problem I am having is I get a runtime error 80010108 when I chose from a dropdown in a combobox it seems to work the first time fine but if I change the selection it errors out...must be an error in my code but I cant figure this out. below is my code (please don't judge me i know its not 'text book')
Code:
Private Sub ComboBox2_Change()
'populate CB3 with CB2 range.value
Dim CB2 As String
Dim MechEng As String
Dim ElecEng As String
CB2 = ComboBox2.Value
MechEng = "Mechanical_Issues_Eng"
ElecEng = "Electrical_Issues_Eng"
Me.ComboBox3.RowSource = CB2
If ComboBox2.Value = MechEng Then
Label12.Visible = True
TextBox9.Visible = True
MsgBox "Please enter the engineering reference number from the - engineering breakdown analysis record"
TextBox9.SetFocus
ElseIf ComboBox2.Value = ElecEng Then
Label12.Visible = True
TextBox9.Visible = True
MsgBox "Please enter the engineering reference number from the - engineering breakdown analysis record"
TextBox9.SetFocus
Else
Label12.Visible = False
TextBox9.Visible = False
End If
End Sub
I believe the error must be due to something in here but cant figure out another way or what needs changing.
Any help is hugely appreciated
Lewie