Form Filter won't clear (1 Viewer)

AndyWilcock

New member
Local time
Today, 14:14
Joined
Nov 19, 2020
Messages
11
So I use this code below to call up a Contacts Form and by filter!!
But the once in Form_Contacts, I can't clear the filter using a macro or VBA to search (using a ComboBox) for another contact.
I've tried

Code:
     Private Sub Search_Contact_BeforeUpdate(Cancel As Integer)
          Me.Filter = Replace(Me.Filter, lastlistboxfilter, "")
          Me.FilterOn = True  ' Error produced 2115 this field is preventing Database from saving the data field
     End Sub
and

Code:
      Private Sub Search_Contact_BeforeUpdate(Cancel As Integer)
           Me.FilterOn = False    ' Error produced 2115 this field is preventing Database from saving the data field
      End Sub
and
Macro - Showallrecords on click of the ComboBox search



Code:
Private Sub Member_DblClick(Cancel As Integer)
On Error GoTo Err_View_Member_Click

    Dim stDocName As String
    Dim stLinkCriteria As String

    stDocName = "Form_Contacts"
  
    stLinkCriteria = "cntID=" & Me.Member
    DoCmd.RunCommand acCmdSaveRecord
    DoCmd.Close
    DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_View_Member_Click:
    Exit Sub

Err_View_Member_Click:
    MsgBox Err.Description
    Resume Exit_View_Member_Click
End Sub
 
Last edited:

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 22:14
Joined
May 7, 2009
Messages
19,169
You have 2 before update event on 1 control?
 

AndyWilcock

New member
Local time
Today, 14:14
Joined
Nov 19, 2020
Messages
11
You have 2 before update event on 1 control?
No they were just two different options I've tried from a Google Search
Sorry the Forum stripped all my formating??
 

Users who are viewing this thread

Top Bottom