I've got the following:
For Each curCustomer As Customer In _customersEdit
If (IsNothing(curCustomer)) Then
Continue For
End If
'other code
If (curCustomer.SeatIDs(0) = primarySeat) Then
'other code
End If
If (curCustomer.SeatIDs.Count = 0) Then
curCustomer = Nothing
End If
Next
After running this code once it's fine, when you run it the second time though I get an error on checking if it's a primary seat because SeatIDs is Nothing. When I set a breakpoint on curCustomer = Nothing it triggered the first time around, I changed the customers name to "test", put a breakpoint on the next line and it did set curCustomer to nothing like it should have. Next when I ran the code again it threw the error on checking the primary seat, and curCustomer still existed with the "test" name I gave it before setting it to Nothing. Why is this happening?