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

    Open form to filtered records

    Access 2003


    Win XP - Win 7

    I need to open the form "frmPeopleList" filtering the field "Position" to only those with values of "Staff".

    From a button with this code:
    Code:
    Private Sub cmdFilter2_Click()
    
        Dim stDocName As String
        Dim stLinkCriteria As String
    
        stDocName = "frmPeopleList"
        
        stLinkCriteria = "[Position]=" & "Staff"
        DoCmd.OpenForm stDocName, , , stLinkCriteria
        
    End Sub


    the above code seems to work but with a parameter box popping up prompting you to type "Staff"

    I am assuming the following line of code needs some tweaking:

    Code:
    stLinkCriteria = "[Position]=" & "Staff"
    
    
    tia

    ducecoop

  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,521
    Try

    stLinkCriteria = "[Position]= 'Staff'"
    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
    yep - that worked.

    Thank you much

    duce out

  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,521
    No problemo, and welcome to the site by the way.
    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. Replies: 2
    Last Post: 07-28-2014, 01:15 PM
  2. making a table from a filtered split form
    By stephenaa5 in forum Queries
    Replies: 2
    Last Post: 08-25-2010, 08:56 PM
  3. Filtered Report
    By Desstro in forum Reports
    Replies: 3
    Last Post: 06-18-2010, 09:09 AM
  4. Replies: 2
    Last Post: 02-26-2010, 08:14 AM
  5. Filtered Print Query
    By Lupus in forum Queries
    Replies: 0
    Last Post: 08-17-2007, 02:50 AM

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