0

when I take away this
dim temp as string it will not work
but when just dim temp
it works and the temp contain eftn

0

the data in rs("eftn") contains surename
and the rs("eftn") is function all over
in serveral places
the program find the data

0

this line

If Not Len(Trim(entry)) = 0 Then LstData3.AddItem entry & "      " & temp

is working that the entry data is rs("email")
and temp is the rs("eftn")
in the same list they work perfectly

0

look this way

If Not Len(Trim(rs("email"))) = 0 Then LstData3.AddItem rs("email") & " " & rs("eftn")

this code works like this

ledan@comhem.se    andersson

in the listbox named lstdata3
but my inteion is to seperat the
email adress and the surename
to 2 diffrent listboxes
and sort them acording to the lstdata3
so i got ledan@comhem in one listbox and the name in the other listbox
because that in the lstdata I can
select several email adress and send them to a Email client
but the surename is coming with it

0

If dim temp as string doesn't work you are returning not a string from your database? Check the properties of the column eftn in the database. Also maybe try this and check what error msg you get:

If Not Len(Trim(entry)) = 0 Then
LstData3.AddItem entry & temp
List1E.AddItem temp
end if
0

this is what I got after the new suggestion
look at picture ( imagelist4)

Attachments Imagelist4.jpg 39.76 KB
0

yes I can and the data is there.

  entry = rs("email")
      temp = rs("eftn")
     'If Not Len(Trim(rs("email"))) = 0 Then LstData3.AddItem rs("email")
    ' If Not Len(Trim(rs("email"))) = 0 Then List1E.AddItem rs("eftn")
     'If Not Len(Trim(rs("email1"))) = 0 Then List2e.AddItem rs("namn")
   'LstData3.AddItem rs("email")
    If Not Len(Trim(entry)) = 0 Then LstData3.AddItem entry & temp
    List1E.AddItem temp

and this is what I get imagelist5

Attachments Imagelist5.jpg 44.71 KB
0

Switch all the sorting in your listboxes off. Line 8 will not work like this. It is like I showed you or you have to use:
If Not Len(Trim(entry)) = 0 Then LstData3.AddItem temp

0

after all this work it's so simple

Thanks a lot for all your time

it works just fine

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.