ListBox problem?

G

Gogzilla

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
 
K

Ken Snell \(MVP\)

Try this:

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

Gogzilla

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
 

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