首页 > 解决方案 > 获取错误 3464 条件表达式中的数据类型不匹配

问题描述

我得到错误 3464 标准表达式中的数据类型不匹配,但我无法离开它有什么问题???

Dim strsql As String
strsql = "select * from Shift where DFail Between " & txtVal1 & " and " & txtVal2
Me.RecordSource = strsql

标签: vbams-access

解决方案


你错过了单引号:

strsql = "select * from Shift where DFail Between '" & txtVal1 & "' and '" & txtVal2 & "'"

但请记住,该文本是从左到右排序的,例如:1, 12, 2, 20.


推荐阅读