I have a sub-form with a combo box to filter selections that works very well. When I created another form with the need for the exact same filter process I did a cut/paste and adjusted the names to agree to the new form. However, when I run the filter in the new form I get the following message.
"The expression "After Update" you entered as the event property setting produced the following error: A Problem Occured While Microsfot Access Was Communicating With The OLE Server Or Active X Control.
*The expression may not result in the name of a macro, the name of a user-defined function, or [Event Procedure]
*There may have been an error evaluating the Function, Event or Macro
Below is the Working Filter Program and the Non-Working Filter Program.
(WORKING FILTER)
Private Sub combo24_AfterUpdate()
'Filter Data via Choice in Client-sfrm
Dim strDept As String
If IsNull(Combo24) Then
Me.FilterOn = False
Else
strDept = Me.Dept
Me.Filter = "Dept='" & Combo24 & "'"
Me.FilterOn = True
With Me.RecordsetClone
.FindFirst "Dept= '" & strDept & "'"
If Not .NoMatch Then
Me.Bookmark = Me.RecordsetClone.Bookmark
Else
End If
End With
End If
Combo24 = Null
End Sub
(NON-WORKING FILTER)
Private Sub DeptFltrSlct_AfterUpdate()
Dim strDept As String
If IsNull(DeptFltrSlct) Then
Me.FilterOn = False
Else
strDept = Me.Dept
Me.Filter = "Dept='" & DeptFltrSlct & "'"
Me.FilterOn = True
With Me.RecordsetClone
.FindFirst "Dept= '" & strDept & "'"
If Not .NoMatch Then
Me.Bookmark = Me.RecordsetClone.Bookmark
Else
End If
End With
End If
DeptFltrSlct = Null
End Sub
What am I missing here?
Thank you for all your help and suggestions.
RobotMush (Technical User) Self Taught
"The expression "After Update" you entered as the event property setting produced the following error: A Problem Occured While Microsfot Access Was Communicating With The OLE Server Or Active X Control.
*The expression may not result in the name of a macro, the name of a user-defined function, or [Event Procedure]
*There may have been an error evaluating the Function, Event or Macro
Below is the Working Filter Program and the Non-Working Filter Program.
(WORKING FILTER)
Private Sub combo24_AfterUpdate()
'Filter Data via Choice in Client-sfrm
Dim strDept As String
If IsNull(Combo24) Then
Me.FilterOn = False
Else
strDept = Me.Dept
Me.Filter = "Dept='" & Combo24 & "'"
Me.FilterOn = True
With Me.RecordsetClone
.FindFirst "Dept= '" & strDept & "'"
If Not .NoMatch Then
Me.Bookmark = Me.RecordsetClone.Bookmark
Else
End If
End With
End If
Combo24 = Null
End Sub
(NON-WORKING FILTER)
Private Sub DeptFltrSlct_AfterUpdate()
Dim strDept As String
If IsNull(DeptFltrSlct) Then
Me.FilterOn = False
Else
strDept = Me.Dept
Me.Filter = "Dept='" & DeptFltrSlct & "'"
Me.FilterOn = True
With Me.RecordsetClone
.FindFirst "Dept= '" & strDept & "'"
If Not .NoMatch Then
Me.Bookmark = Me.RecordsetClone.Bookmark
Else
End If
End With
End If
DeptFltrSlct = Null
End Sub
What am I missing here?
Thank you for all your help and suggestions.
RobotMush (Technical User) Self Taught