Results 1 to 4 of 4
  1. #1
    ducecoop is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Oct 2010
    Posts
    41

    Yet another filter issue :(

    Button currently open a new form for records where thefield [Position] has a value of "Staff'



    Code:
    Private Sub cmdStaffLookup_Click()
    
        Dim stDocName As String
        Dim stLinkCriteria As String
    
        stDocName = "frmPeopleList"
        
        stLinkCriteria = "[Position]= 'Staff'"
    
        DoCmd.OpenForm stDocName, , , stLinkCriteria
    
    End Sub
    but I need it also to only show records where the field [Inactive] is "true" (0)

    I tried using AND at the end of the stLinkCriteria
    but error

    any help would be appreciated

    tia

    dave
    Last edited by ducecoop; 10-29-2010 at 08:42 AM.

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    Same as your other one:

    stLinkCriteria = "[Position]= 'Staff' And Inactive = 0"

    By the way, 0 is False, not True.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    ducecoop is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Oct 2010
    Posts
    41
    lol
    sometimes I get in my own way.

    I had tried exactly what you just gave me and it did not work.
    Come to find out I had it on the "Open" event

    Thanks much

    Dave

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,640
    No problemo.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Criteria Issue
    By RichardS in forum Queries
    Replies: 3
    Last Post: 09-16-2010, 09:19 PM
  2. Criteria or Filter Issue
    By MichaelW in forum Queries
    Replies: 1
    Last Post: 07-06-2010, 01:43 PM
  3. Filter By Form Report (combobox issue)
    By mike.burns7 in forum Reports
    Replies: 1
    Last Post: 06-10-2010, 07:42 PM
  4. Speed issue
    By hey23 in forum Queries
    Replies: 1
    Last Post: 06-24-2009, 09:16 AM
  5. command button to filter a subform issue -
    By countdrako in forum Forms
    Replies: 1
    Last Post: 12-09-2005, 11:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums