List Box Control

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I use the following to fill a list box control. strItem = rs.Fields("PRI").Value & ";" & rs.Fields("Name"). My problem is the Name field has commas in it and when it is displayed in the list box, the data after the comma is displayed in another column. How do I get it to display in 1 column with the comma.
 
Look up the Replace Function: Replace(rs.Fields("Name"), "'", "''"

----- powerml wrote: ----

I use the following to fill a list box control. strItem = rs.Fields("PRI").Value & ";" & rs.Fields("Name"). My problem is the Name field has commas in it and when it is displayed in the list box, the data after the comma is displayed in another column. How do I get it to display in 1 column with the comma.
 
strItem = rs.Fields("PRI").Value & ";" _
& Chr(34) & rs.Fields("Name") & Chr(34)
-----Original Message-----
I use the following to fill a list box control. strItem =
rs.Fields("PRI").Value & ";" & rs.Fields("Name"). My
problem is the Name field has commas in it and when it is
displayed in the list box, the data after the comma is
displayed in another column. How do I get it to display
in 1 column with the comma.
 
Back
Top