Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2012
    Posts
    1

    Unanswered: Combo Box Filter Error

    I've searched and tried various methods to this but nothing seems to be working. I'm trying to create a combo box to filter data on a form, but I keep receiving the following error:

    Run-time Error '2448':
    You can't assign a value to this object.

    The combo event procedure I placed is as follows:
    Private Sub PtLastNameFilter_AfterUpdate()

    Me.Filter = "Last Name = '" & Me.PtLastNameFilter & "'"
    Me.FilterOn = True

    End Sub


    The filtering worked fine for my other combo boxes if the field is numerical:
    Private Sub PtMRFilter_AfterUpdate()

    Me.Filter = "ID=" & Me.PtIDFilter
    Me.FilterOn = True

    End Sub


    Any help to this would be greatly appreciated. Thank you.

  2. #2
    Join Date
    May 2005
    Location
    Nevada, USA
    Posts
    2,888
    Provided Answers: 6
    Not the error I'd expect, but due to the inadvisable space, you likely need to bracket the field name:

    Me.Filter = "[Last Name] = '" & Me.PtLastNameFilter & "'"

    If the names themselves could contain an apostrophe, you'll need to tweak that.
    Paul

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •