match case

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
 
J

John W. Vinson

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
 
J

John W. Vinson

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top