PC Review


Reply
 
 
Sam
Guest
Posts: n/a
 
      6th Feb 2010
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
 
Reply With Quote
 
 
 
 
Douglas J. Steele
Guest
Posts: n/a
 
      6th Feb 2010
If StrComp(A, B, vbBinary) = 0 Then
do something
End If

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)



"Sam" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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


 
Reply With Quote
 
 
 
 
John W. Vinson
Guest
Posts: n/a
 
      6th Feb 2010
On Sat, 6 Feb 2010 07:33:01 -0800, Sam <(E-Mail Removed)> wrote:

>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

--

John W. Vinson [MVP]
 
Reply With Quote
 
John W. Vinson
Guest
Posts: n/a
 
      6th Feb 2010
On Sat, 06 Feb 2010 22:32:32 GMT, "Linq Adams via AccessMonster.com"
<u28780@uwe> wrote:

>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.
--

John W. Vinson [MVP]
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
upper case - lower case issues - dropdown box is case sensitive??? fishqqq@hotmail.com Microsoft Access Form Coding 0 19th Oct 2011 04:58 PM
Lookup Formula: Return 1st match, then 2nd match, then 3rd match Scott Microsoft Excel Misc 4 11th Dec 2009 06:50 AM
Can't find short cut for changing case ... upper case .... lower case JERRY Microsoft Word New Users 7 23rd Aug 2007 05:29 PM
A Case, A Case, My Kingdom For A Case! Spooky Mouse General 8 15th Aug 2004 11:47 PM
Change upper case file names to lower case Sylvain Windows XP Help 0 11th Nov 2003 10:20 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:01 AM.