**User-2127835848 posted**
Hello forum,

i amtrying to populate all the emails in my distributionlist where comms = 'to'

when my code reaches this part it gives me the error

There is no row at position 2 since i have 2 emails with comms = 'to'

For i = 0 To oTable.Rows.Count

row = oTable.Rows(i)

If Not row.IsNull("email") Then

strEmails = strEmails & row.Item(Trim("email")) & ";"

Else

End If

Next

hat i could see is that the for loops twice and strEmails shows the 2 emails but it does no stops there it trys a third loop ans it stops at row = oTable.Rows(i) then it gives the error. I googled the error but everyone talks about grids and i did not find
an answer. Pleas ehelp