I have a number of comboboxes in a form and I am (again) experiencing an issue with the Invalid Property Type error when interacting with the comboboxes and I just can't seem to nail a solution.
Code when the control is entered
This allow the user to accidently type in the cell rather then clicking on the drop down
Code for the Change event
The error is showing when I perform the following
Incredibly frustration and no amount of tinkering with the code seems to fix it.
TIA
Code when the control is entered
VBA Code:
Private Sub cbA_Type_Enter()
cbA_Type.MatchRequired = True
End Sub
Code for the Change event
VBA Code:
Private Sub cbA_Type_Change()
'Just some checks so clearing the form, etc doesn't execute uneccessary code
If boolPF = True Or boolExitSub = True Or strPage <> "ADDRESS" Then
Exit Sub
Else
End If
'If the control is cleared, turn off match reqd otherwise
If cbA_Type.Value = "" Then
cbA_Type.MatchRequired = False
Else
cbA_Type.MatchRequired = True
End If
'If the character typed isn't in the RowSource, clear it
If cbA_Type <> "" And WorksheetFunction.CountIf(wbPD.Sheets("Controls").Range("D_ControlsPT"), cbA_Type) = 0 Then
boolExitSub = True
cbA_Type.Value = ""
boolExitSub = False
Exit Sub
Else
End If
CheckSave
If cbA_Type = "" Then
cbA_Type.SetFocus
Else
txtA_A1.SetFocus
End If
End Sub
Select of an item is made
The control is exited
The selected control has an entry typed in it (it is a textbox)
The combobox is selected again
The selection is cleared
Typing of a character that isn;t the first character of an value sin the row source - This doesn't register as the Change event clears it
TAB is pressed to move to the next control
The INvalid property Type Error shows
Incredibly frustration and no amount of tinkering with the code seems to fix it.
TIA