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

    Exclamation Unanswered: docmd.applyfilter simple problem

    Okay so im trying to do a docmd.applyfilter so that the data within a form is filtered based on a particular value

    one field is "RFC" and the following code works

    DoCmd.ApplyFilter , "RFC = '" & searchValue & "'"

    However, whenever a field has a space in it, it produces an error message as before the space it expects the '=' operator.

    DoCmd.ApplyFilter , "Hardware Model = '" & searchValue & "'"
    DOES NOT WORK as after 'Hardware' it wants '=' not a space(' ').

    How do i get round this problem? I have tried searching Hardware_Model and it prompts me to enter in a value and doesn't work.

    any help would be greatly appreciated

    THANKS IN ADVANCE

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    Try:
    Code:
    DoCmd.ApplyFilter , "[Hardware Model] = '" & searchValue & "'"
    Have a nice day!

Posting Permissions

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