save filter of a table

Discussion in 'Questions (Windows Mobile)' started by manu, Aug 10, 2007.

  1. manu

    manu Active Member Licensed User

    can you help me?

    I am trying to make a filter in a file .csv and save the result in a new file csv , but on having save this table he save the table completes not the filtered results.

    A Greeting.

    Thank you.
  2. Erel

    Erel Administrator Staff Member Licensed User

    You should create a new table, and copy all the filtered rows in the old table to the new table (row by row).
  3. davelew1s

    davelew1s Active Member Licensed User

    copy table

    I am trying to do something similar but cannot work out how to copy the old table to the new table row by row, any help?
  4. specci48

    specci48 Well-Known Member Licensed User

    Hi davelew1s,

    since you can't copy a complete row directly, you have to copy cell by cell:

    Sub Globals
    End Sub

    Sub App_Start
    ' defining both tables with the same columns
    ' adding six rows to table1
    ' setting a filter => three rows left
       Table1.Filter("Col2 = 'value2'")
    ' copy filtered rows from table1 to table2 (cell by cell)
    For i = 0 To Table1.RowCount - 1
    For j = 0 To Table1.ColCount - 1
             Table2.Cell(Table2.ColName(j),i) = Table1.Cell(Table1.ColName(j),i)
    End Sub
  5. davelew1s

    davelew1s Active Member Licensed User

    Hi specci48!
    Thanks that works great now.

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice