3 回答
12345678_0001
TA贡献1802条经验 获得超5个赞
您也可以使用特殊词like:
Public Sub Search()
If "My Big String with, in the middle" Like "*,*" Then
Debug.Print ("Found ','")
End If
End Sub
噜噜哒
TA贡献1784条经验 获得超7个赞
您还可以编写一个函数,如果存在子字符串,则返回TRUE,否则返回FALSE:
Public Function Contains(strBaseString As String, strSearchTerm As String) As Boolean
'Purpose: Returns TRUE if one string exists within another
On Error GoTo ErrorMessage
Contains = InStr(strBaseString, strSearchTerm)
Exit Function
ErrorMessage:
MsgBox "The database has generated an error. Please contact the database administrator, quoting the following error message: '" & Err.Description & "'", vbCritical, "Database Error"
End
End Function
添加回答
举报
0/150
提交
取消