ListBox problem?

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

Guest

Hi all

I try to add data from recordset "r" into ListBox. My recordset has three
fields.

Field_1 Field_2 Field_3
A 10 A11,A12
B 10 B11,B12
C 10 C11,C12
D 10 D11,D12

By this script

[List2].AddItem r![Field_1] & ";" & r![Field_2] & ";" & r![Field_3]

It seems OK but my data in field_3 that has the comma sign. After I use the
above script, Listbox contains the data as these below.

Field_1 Field_2 Field_3
A 10 A11
A12 B 10
B11 B12 C
10 C11 C12
D 10 D11
D12

How can I solve this problem?

Thanks

Gogzilla
 
Try this:

[List2].AddItem r![Field_1] & ";" & r![Field_2] & ";""" & r![Field_3] & """"
 
Hi Ken

Thanks a lot. It actually works.

Gogzilla


Ken Snell (MVP) said:
Try this:

[List2].AddItem r![Field_1] & ";" & r![Field_2] & ";""" & r![Field_3] & """"
--

Ken Snell
<MS ACCESS MVP>

Gogzilla said:
Hi all

I try to add data from recordset "r" into ListBox. My recordset has three
fields.

Field_1 Field_2 Field_3
A 10 A11,A12
B 10 B11,B12
C 10 C11,C12
D 10 D11,D12

By this script

[List2].AddItem r![Field_1] & ";" & r![Field_2] & ";" & r![Field_3]

It seems OK but my data in field_3 that has the comma sign. After I use
the
above script, Listbox contains the data as these below.

Field_1 Field_2 Field_3
A 10 A11
A12 B 10
B11 B12 C
10 C11 C12
D 10 D11
D12

How can I solve this problem?

Thanks

Gogzilla
 
Back
Top