Conventional wisdom suggests this code works fine when checking a field in a database-or any Variant, for that matter-for inequality to some other value:
If ![Name] <> "abc" Then Debug.Print "<>"Else Debug.Print "="End If
In reality, however, this isn’t always the case. For example, if the field you’re checking is of value Null, then the test also returns Null, invoking the Else clause. A quick, though perhaps obscure solution, is to check for equality instead:
If ![Name] = "abc" Then Debug.Print "="Else Debug.Print "<>"End If
Charlie has over a decade of experience in website administration and technology management. As the site admin, he oversees all technical aspects of running a high-traffic online platform, ensuring optimal performance, security, and user experience.
























