Discussion in 'Questions (Windows Mobile)' started by Phil Budge, May 13, 2007.

  1. Phil Budge

    Phil Budge New Member Licensed User

    With the Table.Filter command is it possible to use variables as the Column and Arguement as I can only make this function work with fixed values.
  2. specci48

    specci48 Well-Known Member Licensed User

    Hi Phil,

    let's take the following Table

    Table1.AddCol(cNumber, "Number", 50)
    Table1.AddCol(cString, "Value1", 50)
    Table1.AddCol(cString, "Value2", 50)

    Table1.AddRow(1, "A1", "red")
    Table1.AddRow(1, "A2", "green")
    Table1.AddRow(2, "A2", "blue")
    Table1.AddRow(2, "A2", "white")
    Table1.AddRow(2, "A4", "black")

    and these two variables

    arg1 = 2
    arg2 = "A2"

    For a column with cNumber format we could code this filter

    Table1.Filter("Number = " & arg1)

    Result: the rows with "blue", "black" and "white".

    To code a filter with a column of cString format you have to add some ' around the variables like

    Table1.Filter("Value1 = '" & arg2 & "'")

    Result: the rows with "green", "blue" and white.

  3. Phil Budge

    Phil Budge New Member Licensed User

    Thanks specci48 that explained the syntax ( I've only been using BASIC4PPC a couple of days)
  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