Benginner2212
Member
- Local time
- Today, 09:59
- Joined
- Apr 6, 2023
- Messages
- 52
Okay, now I see what is going on with the code.Interesting. I frequently write conditionals using positive questions as the OP did. I especially avoid them when they start with "not". I think it is because I don't think of the code I write as being for myself. I think of it as being for others to read and in general, people have an easier time of following positive logic than following negative logic. They also have a tendency to skip over the leading "not" and so miss the point of the condition. Therefore, unless taking a positive path gets convoluted, that's my style. "Positive Patty"
It has to do with the fact that when you compare null to ANYTHING, the answer is Null. It is never True or False.
So If A = Null Then --- will NEVER return true, even when A is actually null. So, If Null = Null -- is never true.
Most people check for null separately. But, you can sometimes get around the issue using a couple of different techniques.
If Me.fldA & "" = Me.fldB & "" Then - By concatenating null with a ZLS (Zero Length String), you end up with a ZLS which is not null and so will produce the expected result when compared.
Null & "" = Null & "" -- will result in True
Sorry for the delay in my response, the last couple of weeks at work have been busy.
Thank you Pat for everything. With your help I was able to really mitigate the possibility of critical data accidentally being overwritten.
I'll be marking this thread as solved.
Thanks Again