Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

How to add a filter in Visual Basic?

Discussion in 'Information Technology' started by danijela.simunovic@gmail.com, Nov 1, 2005.

  1. danijela.simunovic@gmail.com

    Guest

    How do I add a filter in VB?
    is this enough: DoCmd.ApplyFilter , "LastName = 'King'" or I
    need something before this which would say in which table or query?
    And how do i close the filter,how do i remove it?

    Danijela
     
  2. Loading...


  3. Van T. Dinh

    Van T. Dinh
    Expand Collapse
    Guest

    DoCmd.ApplyFilter does not have an argument for the object the Filter will
    be applied to. The filter will always be applied to the *active* data
    object, i.e. the object in active MDI window which can be DatasheetView of a
    Table / a Query or a Form. For Reports, the ApplyFilter will only work in
    the Open Event.

    --
    HTH
    Van T. Dinh
    MVP (Access)



    <danijela.simunovic@gmail.com> wrote in message
    news:1130754591.556634.64470@o13g2000cwo.googlegroups.com...
    > How do I add a filter in VB?
    > is this enough: DoCmd.ApplyFilter , "LastName = 'King'" or I
    > need something before this which would say in which table or query?
    > And how do i close the filter,how do i remove it?
    >
    > Danijela
    >
     

Share This Page