Results 1 to 2 of 2

Thread: [RESOLVED] Multiple filter with Combobox or checkbox

  1. #1

    Thread Starter
    Member
    Join Date
    Dec 2006
    Posts
    35

    Resolved [RESOLVED] Multiple filter with Combobox or checkbox

    I want to do the following,
    I have a database with a field that has the AREA letter. Exsaple P from Process. Each area can have many items.
    When I open the form it lists me all the items from all areas in a listview. Now what I want to do is to change add a filter to my SQL statement acording to my combobox or checkbox.
    Lets start easy, I have only one combobox and want to filter the selected area. Dont forget if I have not selected something, it has to show all items.

    Thanks

  2. #2

    Thread Starter
    Member
    Join Date
    Dec 2006
    Posts
    35

    Re: Multiple filter with Combobox or checkbox

    I found the way to do it.

    Code:
        If Combo1 <> "All" Then
            rst.Open "SELECT SUM(total)AS [SubTotales] FROM db where nroproj ='" & Combo1 & "'", base
        Else
            rst.Open "SELECT SUM(total)AS [SubTotales] FROM db ,base
        
        End If

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width