Minimalist 96 Posting Pro

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
Minimalist 96 Posting Pro

I don't understand what you mean by rs("eftn") is function

Minimalist 96 Posting Pro

So what sort of data is contained in rs("eftn")?
and does your program now as you want it to?

Minimalist 96 Posting Pro

Maybe replace line 14 with:
if rs("eftn") <> "" then
temp= rs("eftn")
else
temp="---"
end if

Minimalist 96 Posting Pro

You have to find out why it stopped at line 14 - is there any data in rs("eftn")

Minimalist 96 Posting Pro

Now in regards to your sorting, obviously you only can sort by one listbox at the time. So you add the first item to the listbox you want your data sorted by. You get the index of where the item is added and than you insrt the items in the other listboxes at this index.

Minimalist 96 Posting Pro

O.K. let' assume you got all the correct data. You now have to look at the data you add. If temp is empty, what you do than?
You add data to the first listbox, but nothing to the second. So if the next data comes along you add it to the first listbox at an index that will be different from the index in the second listbox. So if temp=" " then add something like Temp= "----", that will avoid the distortion of added entries.

Minimalist 96 Posting Pro

O.K. let's take it bit by bit. First check that the loop works and returns the correct entries. Rem everything out but the stuff that returns the strings. Dimension the strings correctly and we check that the counter works. Print everything to debug.

Dim icounter As Integer
    Dim entry as String
    Dim temp as String
    iCounter=0
    'Check if the recordset contain records'
    If Not rs.RecordCount = 0 Then
    'Move to the first record'
    rs.MoveFirst
    'Loop till the recordset return EOF(end of file)'
    While Not rs.EOF
    ' For i = 1 To max
entry = rs("email")
Debug.print(entry)
temp = rs("eftn")
Debug.print(temp)
'If Not Len(Trim(entry)) = 0 Then LstData3.AddItem entry & temp
'If Not Len(Trim(entry)) = 0 Then List1E.AddItem temp
'If Not Len(Trim(rs("email"))) = 0 Then List2e.AddItem rs("namn")
    'do some stuff here'
     icounter = icounter + 1
     Debug.print(iCounter)
    'Move to the next record'
    rs.MoveNext

    Wend
    End If
Minimalist 96 Posting Pro

Happy New Year to You too.

From what I see you use trhe i as a counter but set it up like a loop.
Just dim it outside your record retrieval and than add 1 to it :

dim icounter as Integer
'Check if the recordset contain records'
If Not rs.RecordCount=0 Then
'Move to the first record'
   rs.MoveFirst
'Loop till the recordset return EOF(end of file)'
   While Not rs.EOF
     'do some stuff here'
'Move to the next record'
      rs.MoveNext
      iCounter = iCounter + 1
   Wend
End If

Also check this one out:
http://visualbasic.freetutes.com/learn-vb6/lesson4.html

Minimalist 96 Posting Pro

Well looking at the second picture I can see thet you are not retrieving the data correctly or it is strored incorrectly.

Minimalist 96 Posting Pro

OK, did you check the data you are returning? You can use something like debug.print("Your Data") to see what your loop is returning. Nake sure the data is stored correctly in your database - open it with access and have a look. I will check later that you use the correct code - from memory there is something like an index, like LstData3.AddItem rs("Email1",0) - check it and I will get back.

Minimalist 96 Posting Pro

If you get the samedata in each listbox you need to check how you retrieve the data. Where is your data stored in?

Minimalist 96 Posting Pro

OK, but I can just see one listbox in your code. So I just give you a rough idea:
Your existing code:

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

Ok, now lets assume you have 3 listboxes, LstData4,LstData5
then you want to clear these so the index starts at 0
and you would do something like:

If Not Len(Trim(rs("Email1"))) = 0 Then
LstData3.AddItem rs("Email1")
LStData4. AddItem rs("eftn")
LstData5.AddItem rs("namn")
end if

Minimalist 96 Posting Pro

The trick now is to keep your listboxes synchronised via the index properties of the listboxes. Clear the listboxes, add the email to the first one get the index where you added and add the next bit of info into the second one at the same index from the first listbox. If you remove an item in the first one you need to get the index and remove the same index in the second listbox, this way you synchrinse the listboxes.

Minimalist 96 Posting Pro

Net Framework 4 CLR20r3 Error
http://social.msdn.microsoft.com/Forums/vstudio/en-US/a7ed93ad-2923-48c4-9e51-cf0bd6d4e100/net-framework-4-clr20r3-error?forum=netfxsetup
From what I have been reading it could be that you compiled your program to a higher Famework version then what is installed on your friends computer.

Minimalist 96 Posting Pro

You are already using the Len() method. So you need to dim an integer like dim intLen and than assign it the Len of your email
like: intLen= Len(Trim(rs("Email1"))). Alternatively you can count the characters in a string.

Minimalist 96 Posting Pro

I've created all the forms I need for it work but I cant create the main form that the user will use to choose what action will be executed,

Click on MyProject which opens a new tab and there you can set the startup form that will be displayed when your program is started.

Minimalist 96 Posting Pro

There isno easy way or no way to change the forecolor of a command button. Workaround is easy. Instead of using a command button use a checkbox. This has the same properties as a command button but also a forecolor property.
What you do is set the property style to graphical. The checkbox looks like command button after and you can set the forecolor

Check1.ForeColor = vbRed
Minimalist 96 Posting Pro
Minimalist 96 Posting Pro

Just double click on "Sub sub menu 3.3" and add something like this:

Private Sub LoadForm2ToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles LoadForm2ToolStripMenuItem.Click
        Form2.Show()
    End Sub

also check this link out:
http://www.tutorialspoint.com/vb.net/vb.net_menustrip.htm