runtime Error.. cant assign value to this object

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I am using the Search Code found in the Microsoft Issues Database Template
Everything works but the filter

i get an error message that says Runtime error 2448 " you cant assign a
value to this object"

On Debug this is the highlighted code
Me.F_BrowseAllParts.Form.Filter = strWhere

My Subform is F_BrowseAllParts

does anyone know where im going wrong??

Heres my code.



Private Sub Search_Click()
Dim strWhere As String
Dim strError As String

strWhere = "1=1"

' If PartNumber
If Not IsNull(Me.PartNumber) Then
'Create Predicate
strWhere = strWhere & "T_PartNumbers.PartNumber = " & Me.PartNumber
& ""
End If

' If Category
If Nz(Me.Category) <> "" Then
'Add it to the predicate - exact match
strWhere = strWhere & " AND " & "T_PartNumbers.CategoryID = '" &
Me.Category & "'"
End If

' If Description
If Nz(Me.Description) <> "" Then
' Add it to the predicate - match on leading characters
strWhere = strWhere & " AND " & "T_PartNumbers.Description Like '*"
& Me.Description & "*'"
End If

If strError <> "" Then
MsgBox strError
Else
'DoCmd.OpenForm "F_BrowseParts", acFormDS, , strWhere, acFormEdit,
acWindowNormal
If Not Me.FormFooter.Visible Then
Me.FormFooter.Visible = True
DoCmd.MoveSize Height:=Me.WindowHeight + Me.FormFooter.Height
End If
Me.F_BrowseAllParts.Form.Filter = strWhere
Me.F_BrowseAllParts.Form.FilterOn = True

End If
End Sub
.



Relevant Pages

  • runtime error 3075
    ... Dim strWhere As String ... Dim strError As String ... 'Create Predicate ... 'Add it to the predicate - exact match ...
    (microsoft.public.access.formscoding)
  • RE: Run-time error 2001: You have cancelled previous operation
    ... I think the problem is that the strWhere you create is for the Browse ... Dim strWhere As String ... 'Create Predicate ... 'Add it to the predicate - exact match ...
    (microsoft.public.access.formscoding)
  • Re: Appointment Dates
    ... I tried this code but everytime I insert the code in I get an error message ... > Dim strWhere As String ... >> time and appoinment duration for a Sales Rep. ...
    (microsoft.public.access.forms)
  • Help, Runtime error 2001, You Canceled the Previous Operation
    ... Dim strWhere As String ... 'Create Predicate ... Me.[Browse All RCA Events].Form.Filter = strWhere ...
    (microsoft.public.access.macros)
  • Re: Change filter source from table to query
    ... Your code builds up a filter string (strWhere), and assigns it to the Filter of the form. ... If the user now wants to print the same results, you can use that filter string as the WhereCondition for OpenReport. ... 'Create Predicate ... 'If Employee Number (tblEmployeeProjectDetails) ...
    (microsoft.public.access.formscoding)