match case

  • Thread starter Thread starter Sam
  • Start date Start date
S

Sam

I have two string expressions, A and B, that I would like to check for case
match.
In my code I have

If A=B Then
do something
End If

I need for the comparison to be case sensitive. How can I do that?
Thanks so much!
Sam
 
I have two string expressions, A and B, that I would like to check for case
match.
In my code I have

If A=B Then
do something
End If

I need for the comparison to be case sensitive. How can I do that?
Thanks so much!
Sam

Use the builtin StrComp() function:

If StrComp(A, B, vbBinaryCompare) = 0 Then
 
If you wanted ***all comparisons*** in your form to be Case Sensitive, at the
top of your code module you could replace

Option Compare Database

with

Option Compare Binary

Linq, won't that just make VBA comparisons case sensitive? My understanding is
that Queries will still be insensitive to case.
 
Back
Top