Misbehaving list box

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
 
D

dne

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
 
R

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

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

I seem to have misplaced my Irish pub.
 

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