locked
There is no row at position # RRS feed

  • Question

  • 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





    Thursday, February 11, 2010 7:20 PM

Answers

  • User-1360095595 posted

     For i = 0 To oTable.Rows.Count - 1

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, February 11, 2010 9:19 PM

All replies

  • User-1360095595 posted

     For i = 0 To oTable.Rows.Count - 1

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, February 11, 2010 9:19 PM
  • User-2127835848 posted

    Thank you worked like a sharm

     For i = 0 To oTable.Rows.Count - 1


    Thursday, February 11, 2010 11:10 PM