Results 1 to 6 of 6
  1. #1
    jaryszek is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    568

    Disable filter within one column on Access form -datasheetview

    Hi Guys,

    it is possible to disable filter on open form?

    I am using button and cocmd.open form with specific criteria, here login.

    So if user has login "ljar01" then form will shows only his records (with login "ljar01").
    I want to show the users only filtered records.



    And second condition. There is a user group where they shoud see each others records.

    So for user ljar01, pzie00 and mras05 there should be only records with these usernames.

    And my dream is to have possibility to filter 2 or 3 criteria on datasheet view form, disable possibility for filtering within Login column only and rest columns should have possibility to filter.

    Click image for larger version. 

Name:	Filtering.png 
Views:	10 
Size:	19.7 KB 
ID:	31011

    please help Guys,
    Best Wishes,
    Jacek

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    when the user opens the db, there should be an invisible text box to hold the userID when the form opens:

    Code:
    txtUserID = Environ("Username")
    me.filter = "[loginID]='" & txtUserID & "'"
    me.filterOn = true
    turn off the filter with:
    me.filterOn = false

    BUT, if you want the user to see only specific group of Logins, then you must have a table to hold the list.
    then the query that shows the data would join to this ....

    select * from tData, tUsers2See where tData.UserID = tUsers2See.UserID and tUsers2See.GroupID = forms!myForm!txtUserID

  3. #3
    jaryszek is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    568
    thank you ranman256!

    I know your solution. And it is okey but i want to disable possibility to choose another filter (so here is ljar01 but still able to choose another login):

    Click image for larger version. 

Name:	possibility.png 
Views:	10 
Size:	126.8 KB 
ID:	31012

    Maybe here i should use recordset only ?

    Best Wishes,
    Jacek

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    set the form property ALLOWFILTERS = FALSE

  5. #5
    jaryszek is offline Expert
    Windows 7 32bit Access 2010 32bit
    Join Date
    Aug 2016
    Posts
    568
    thank you !

    It is possible to allowfiltering set as false only to one column?

    Best Wishes,
    Jacek

  6. #6
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,550
    no...the entire dataset filters, not 1 column.
    but you can filter ON 1 column if filtering is allowed.

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

Similar Threads

  1. Access expand node of tree in datasheetview
    By jaryszek in forum Programming
    Replies: 8
    Last Post: 07-25-2017, 06:32 AM
  2. Replies: 1
    Last Post: 03-14-2017, 06:46 AM
  3. Multiple Column Filter
    By Elwood07 in forum Access
    Replies: 5
    Last Post: 04-02-2016, 07:17 PM
  4. Replies: 1
    Last Post: 12-09-2011, 05:02 PM
  5. Filter form by column
    By smikkelsen in forum Forms
    Replies: 10
    Last Post: 04-27-2010, 10:46 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