使用變數篩選項目
在 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 支援與意見反應。