Hi all,
I believe prevention is the best cure, but what I'm doing is overkill I think.
I have an Insert command button that is enabled AFTER this combo is updated.
BUT, I know somewhere down the line a user may clear the combo, making it null, which will in turn cause an invalid use of null error message.
The reason I've developed a habit to do the two IF's above, is in my previous project, I used just the top IF statement that worked fine for a while, then I changed it to the bottom IF statement which worked fine for only some time.
In the end I've had to use both because maybe im going crazy, sometimes one wont work for all situations.
Am i doing something wrong?
I believe prevention is the best cure, but what I'm doing is overkill I think.
I have an Insert command button that is enabled AFTER this combo is updated.
BUT, I know somewhere down the line a user may clear the combo, making it null, which will in turn cause an invalid use of null error message.
Code:
If IsNull(cboSelectTrade.Value) Then
MsgBox "Select a trade to insert."
GoTo function_end
End If
If cboSelectTrade.Value = "" Then
MsgBox "Select a trade to insert."
GoTo function_end
End If
The reason I've developed a habit to do the two IF's above, is in my previous project, I used just the top IF statement that worked fine for a while, then I changed it to the bottom IF statement which worked fine for only some time.
In the end I've had to use both because maybe im going crazy, sometimes one wont work for all situations.
Am i doing something wrong?