Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2015
    Posts
    7

    Unanswered: Urgent urgent please Help like in filter

    I have spent hours attempting to find the right syntax for the following.

    afterupdate event
    me.filter = "select * from table where [field] like '*" & txtFilter & "*'"
    me.filterOn = true

    Getting a syntax error with the query error 3075
    I have tried without quotes and no * etc to no avail
    I have a form datasheet and a field which is a combo box.
    I need to include a "like" in the filter but cant seem to achieve the result.
    txtfilter above needs to be the actual filter value selected "if possible".
    I have ms office 2010
    PLEASE please help
    Regards
    Norm

  2. #2
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    When applying a filter rffectively its a where clause without the word where in it. So in your case delete everything before [field]
    I'd rather be riding on the Tiger 800 or the Norton

  3. #3
    Join Date
    Aug 2015
    Posts
    7
    The syntax works well but it selects all the filters not the one selected.
    Is there a way of capturing the actual value of the filter selected when the others are not ticked.
    At the moment txtfilter selects ALL the filters listed for the field.
    And what event would be best for this.........thanks.
    It is also a multi select field as well. I think that's the problem as i'm also getting wrong "data type" and I think its not possible what I'm trying to achieve.
    Appreciate some urgent help
    Regards
    Norm

  4. #4
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    What is the actual value of txtfiltet?
    ....not what you think it is
    ....nor what you believe it is
    ...either put a watch/breakpoint on the code and ecamine it in the debugs immediate window or output the value using a msgbox

    As to whats the best evdnt gor this code i havent got a scooby. From your explanation so far i dont know ehat you are trying to achieve. Im not clear what is or isnt working.
    I'd rather be riding on the Tiger 800 or the Norton

Posting Permissions

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