runtime Error.. cant assign value to this object

B

Barry A&P

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top