Code Error - There is more than one item with this name...

You guys are great. Thanks a lot.

David’s CHRB() worked using those values. This has been a good lesson. Thanks

So when I use this I can now populate the list:

vWO_Name = vWO_Name.ReplaceAll(ChrB(&H93),Chr(34))
vWO_Name = vWO_Name.ReplaceAll(ChrB(&H94),Chr(34))

This raises the question, would you consider it a bug that the list does not appear to support smart quotes? To me it seems like it should, but what do I know?

The listbox has no issue with smart quotes

Dim s As String
s = ConvertEncoding(s, Encodings.WindowsLatin1)
s = s + Encodings.WindowsLatin1.Chr(&h93) + "hello world" + Encodings.WindowsLatin1.Chr(&h94) 
listbox1.addrow s

will insert smart quotes in the listbox without problem

BUT, now that I read the code you posted more closely, I can see why this issue exists in your code

vWO_Name = data.field("WO_Name").StringValue

This code assumes that the string coming from the DB has a specific encoding - so the certain string functions will work as expected
But it doesn’t
And this is a common issue when data comes in from outside sources like databases, sockets, serial ports and even files.
The encoding of the data is not known and so strings functions may appear to misbehave because of this

if however this code was

vWO_Name = data.field("WO_Name").StringValue
vWO_Name = DefineEncoding(vWO_Name, Encdings.WindowsLatin1)

You would get rid of the root of the problem and lines like

wWO_Name = wWO_Name.ReplaceAll(chr(34),"X")
wWO_Name = wWO_Name.ReplaceAll(Encodings.WindowsLatin1.Chr(&h93),"X")
wWO_Name = wWO_Name.ReplaceAll(Encodings.WindowsLatin1.Chr(&h94),"X")

would do EXACTLY as expected without having to resort to the CHRB versions which should be avoided when you are dealing with TEXTUAL data

EDIT : Textual data in apps is no longer simple “ascii” (ANSI is just one of many possible single byte encodings - also known as Windows Latin 1)
see https://blog.xojo.com/2013/08/20/why-are-there-diamonds-in-my-user-interface/
https://blog.xojo.com/2019/02/25/programming-pitfalls/
https://blog.xojo.com/2017/02/17/do-you-still-ascii/

Great clarification and explanation, Norman. I’ll read up on your links.