I have a bigger code block which I have recreated in this simpler example:
Dim evalcheck As Boolean
Dim aEntityId, bEntityId As Integer?
Dim aCheckNumber, bCheckNumber As Integer?
aEntityId = Nothing
bEntityId = Nothing
aCheckNumber = Nothing
bCheckNumber = Nothing
evalcheck = aEntityId = bEntityId And aCheckNumber = bCheckNumber
I get nullable object must have a value when I compare Nothing to Nothing pairs.
Is there a quick fix for the eval part –
evalcheck = aEntityId = bEntityId And aCheckNumber = bCheckNumber
You should really use parentheses for readability. Even then, the comparison is ugly.
I prefer this method better though
You evalcheck line becomes