I have a table in mdb with field address, which will contain street address e.t.c as string. I want to be able to search part of this record.
我在mdb中有一个带有字段地址的表,它将包含街道地址e.t.c作为字符串。我希望能够搜索此记录的一部分。
sCriteria = "address like " & "'" & streetAddr & "'"
Rs1.Filter = sCriteria
it searches for e.g "Mall" while there is a record "Mall Road" which should have been found but is not as Road is missing, what should i do to make part of field searchable
它搜索例如“购物中心”,而有一条记录“商城路”本应该被找到但不是道路遗失,我应该怎么做才能搜索到现场搜索的一部分
2 个解决方案
#1
3
Try
尝试
sCriteria = "address like '*" & Quote(streetAddr) & "*'"
where Quote
does a simple Replace(sText, "'", "''")
其中Quote做了一个简单的替换(sText,“'”,“''”)
#2
0
Put an '*' before the closing single-quote, after the filter value.
在结束单引号之前,在过滤器值之后加上'*'。
#1
3
Try
尝试
sCriteria = "address like '*" & Quote(streetAddr) & "*'"
where Quote
does a simple Replace(sText, "'", "''")
其中Quote做了一个简单的替换(sText,“'”,“''”)
#2
0
Put an '*' before the closing single-quote, after the filter value.
在结束单引号之前,在过滤器值之后加上'*'。