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
and
and
Macro - Showallrecords on click of the ComboBox search
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
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
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: