Returning records that partially match a value

前端 未结 5 552
悲哀的现实
悲哀的现实 2021-01-06 07:13

I\'m trying to get a query working that takes the values (sometimes just the first part of a string) from a form control. The problem I have is that it only returns records

5条回答
  •  不要未来只要你来
    2021-01-06 08:07

    Two things are going on - the comparisions should be reversed and you are not quoting strings properly.

    It should be [database field] like "partial string + wild card"

    and all strings need to be surrounded by quotes - not sure why your query doesn't throw errors

    So the following should work:

    ,[customerforname] Like  """" & [Forms]![FrmSearchCustomer]![SearchFore] & "*""" )=True
    

    Note the """" that is the only way to append a single double-quote to a string.

提交回复
热议问题