Was trying to save the contents of a listview column (2nd column) into a table in the dbase, 1 column of the table per content of the listview column, meaning only 1 row will be affected.

Here's my code using while loop.

Fcount = 2
Scount = 1

  While Scount <> Me.lvsub2.ListItems.Count And Fcount <> 11
      RS2.Fields(Fcount) = Me.lvsub2.ListItems(Me.lvsub2.ListItems.Count).SubItems(Fcount)

    Fcount = Fcount + 1
    Scount = Scount + 1


Works but the problem is that, it only saves items from the 1st column of the listview and it gives an error ones there is a null value from the listview's column.
Any way to get around this with just a small modification of the code?

Recommended Answers

All 2 Replies

Sorry, but what I want is a shorter way so modifying my code would be great.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.