Misbehaving list box

  • Thread starter Thread starter RD
  • Start date Start date
R

RD

Hi all,

I have a form with two text boxes and a list box (among other controls). The
user inputs a last name and a first name and then hits a button (or just hits
Enter) and the name is added to the list box. I concatenate the name for
display purposes. Things were going great till it was decided that the name
should be displayed Last, First. For some reason, the list box is seeing the
comma as a delimiter and is breaking up the names onto separate lines in the
list box.. According to Help, a value list is delimited by semicolons, not
commas.

Anyone have any ideas about why this is happening and/or how to get around it?

Thanks,
RD
 
You have to enclose the entire Last, First in quotes like this

"Last, First"; "LastName, FirstName"

Because if you leave them out, it will automatically convert the commas
to semicolons.

Assuming that you are concatenating the names in code, when you add
them to the list box it should look something like:

chr(34) & Lastname & ", " & firstName & chr(34)

where chr(34) is the character code for a quotation mark


D
 
You have to enclose the entire Last, First in quotes like this

"Last, First"; "LastName, FirstName"

Because if you leave them out, it will automatically convert the commas
to semicolons.

Assuming that you are concatenating the names in code, when you add
them to the list box it should look something like:

chr(34) & Lastname & ", " & firstName & chr(34)

where chr(34) is the character code for a quotation mark


D

I just had a "Doh!" moment. Thanks for setting me straight.

I seem to have misplaced my Irish pub.
 
Back
Top