>> Find SR

  • Thread starter Thread starter Jonathan
  • Start date Start date
J

Jonathan

Hi using Access2003 I want to search a string for upper case SR. The following

InStr(1, ReportName, Chr(83) & Chr(82)) < 1

Returns true for sr sR Sr

How do I find only strings containing upper case SR? Any ideas or
suggestions appreciated. :-)

Many thanks
Jonathan
 
Use vbBinaryCompare... this should distinguish between uppercase and
lowercase (though in 2003 at least, this seems to be the default)

my test:

?instr(1, "srSR", "SR", vbBinaryCompare)
3

....seems to be what you are looking for

hth

--
Jack Leach
www.tristatemachine.com

"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)
 
Perfect. I really should know by now to check for optional arguments!

Many thanks,
Jonathan
 
Perfect. I really should know by now to check for optional arguments!

Oddly enough, the optional argument for this is supposed to default to
BinaryCompare, but obviously doesn't, as you need to make sure you put it in.

--
Jack Leach
www.tristatemachine.com

"I haven''t failed, I''ve found ten thousand ways that don''t work."
-Thomas Edison (1847-1931)
 
Its Microsoft. Why would that be odd?

I've been messing with ASP.NET and much to my ire found that the ImageButton
control automatically adds an inline CSS style for a border for no practical
reason other than it was coded to do so. Obviously, the Redmond is nothing
short of ground-zero for the ID-10-T virus.
 
Back
Top