Results 1 to 2 of 2
  1. #1
    akika is offline Novice
    Windows 10 Access 2016
    Join Date
    Aug 2018
    Posts
    27

    access 16, Filter datasheet


    Hi,

    I have several users that are using a form and its displaying the last filter done by another user.
    How to reset the filter to display all the records but keeping the filter on specific columns which will be used by the search button?

    I'm using a split form and in filter, form properties, have below cmd..

    Nz([Name],"") Like "*" & Forms!Details!Text214 & "*" And Nz([Street],"") Like "*" & Forms!Details!Combo224& "*" And Nz([City],"") Like "*" & Forms!Details!Text202 & "*" And Nz([Town],"") Like "*" & Forms!Details!Combo244 & "*" And Nz([Representative],"") Like "*" & Forms!Details!Text246 & "*" And Nz([Status],"") Like "*" & Forms!Details!Combo248 & "*" And Nz([Code],"")

    Search button cmd
    Me.Requery
    DoCmd.RefreshRecord

    Clear Button cmd
    Me.Text214 = ""
    DoCmd.GoToRecord , , acNewRec

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    Each user has their own copy of the Front end app , right?
    but also, open the form with the filter off at FORM LOAD:
    Me.FilterOn = False

    make filter:
    Code:
    '----------------
    sub btnFilter_click()
    '----------------
    dim sWhere as string 
    
    
    sWhere = "1=1"
    if not IsNUll(cboST) then sWhere = sWhere & " and [State]='" & cboST & "'"
    if not IsNUll(cboCity) then sWhere = sWhere & " and [city]='" & cboCity & "'"
    if not IsNUll(cboZip) then sWhere = sWhere & " and [ZipCode]='" & cboZip & "'"
    
    If sWhere = "1=1" Then
      Me.FilterOn = False
    Else
      Me.Filter = sWhere
      Me.FilterOn = True
    End If
    
    end sub

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

Similar Threads

  1. Filter datasheet with combobox
    By hinchi1 in forum Access
    Replies: 1
    Last Post: 03-31-2020, 02:46 AM
  2. Filter datasheet with combobox
    By hinchi1 in forum Access
    Replies: 1
    Last Post: 03-29-2020, 09:48 AM
  3. Textbox Filter Contain in Datasheet
    By margzj in forum Access
    Replies: 6
    Last Post: 08-03-2017, 04:04 AM
  4. Replies: 2
    Last Post: 05-26-2016, 11:20 AM
  5. Replies: 3
    Last Post: 12-31-2011, 06:18 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