使用变量筛选项目

使用来自变量的值作为 Microsoft Jet 语法或 DAV 搜索和定位 (DASL) 语法中的筛选器的一部分。 下面的示例演示了如何将变量用作筛选器的组成部分:

fullname = "Dan Wilson" 
' This approach uses Chr(34) to delimit the value.  
criteria = "[FullName] = " & Chr(34) & fullname _ & Chr(34) 
' This approach uses the double quotation mark to delimit the value.  
criteria = "[FullName] = """ & fullname & """" 
' This approach uses the escaped hexadecimal value of the double quotation mark to delimit the value.  
criteria = "[FullName] = "%22" & fullname & "%22"" 

支持和反馈

有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。