How do I make InStr case sensitve in MS Access

ms-access, string, string-comparison, vba

Solution

The help topic doesn't make this point clear, but when you use the optional compare argument, you need to also supply the optional start argument in order to avoid that type mismatch complaint.

So this displays 0 in the `MsgBox`:

MsgBox InStr(1,"In Here", "here", vbBinaryCompare)

Problem

How do I make InStr case sensitive in MS Access? I'd like the following to display `0` ``` msgbox InStr("In Here", "here") ``` Instead I get `4`. I've tried adding vbBinaryCompare ``` msgbox InStr("In Here", "here", vbBinaryCompare) ``` but it complains about a type mismatch.

Original source