G
Guest
Thanks for taking the time to read my question.
I have combo boxes that if the value selected is the same as another combo
box, displays a message saying so, and SHOULD undo the change and make the
user select another value.
My code isn't working.
CantChoose is a function that sets CantChooseVal to True if criteria met. I
have stepped through the code and it enters the if, but the value of the
combo box doesn't change back.
I don't know why.
Please help,
Brad
Code:
Private Sub SplitCategory1_BeforeUpdate(Cancel As Integer)
CantChooseVal = False
CantChoose (1)
If CantChooseVal = True Then
MsgBox "This Category has been chosen on another record. Please select
another category, or change the category of the record that has the same
value.", 16
Me.SplitCategory1.Undo
'Cancel = True
End If
End Sub
I have combo boxes that if the value selected is the same as another combo
box, displays a message saying so, and SHOULD undo the change and make the
user select another value.
My code isn't working.
CantChoose is a function that sets CantChooseVal to True if criteria met. I
have stepped through the code and it enters the if, but the value of the
combo box doesn't change back.
I don't know why.
Please help,
Brad
Code:
Private Sub SplitCategory1_BeforeUpdate(Cancel As Integer)
CantChooseVal = False
CantChoose (1)
If CantChooseVal = True Then
MsgBox "This Category has been chosen on another record. Please select
another category, or change the category of the record that has the same
value.", 16
Me.SplitCategory1.Undo
'Cancel = True
End If
End Sub