VB 实时错误 过滤器不能被打开
小弟我接触VB半个月了,现在正跟着一本教材上的实例做,测试运行出现如题情况
代码如下
Private Sub Form_Load()
Dim strNum As String
With Drug_Store.rsShoppingCars
If .State = adStateClosed Then .Open
.Requery
.Filter = "日期 Like '" & Date & "%'"
If .EOF Then
strNum = Format(Date, "yymmdd") & "00001"
Else
.MoveLast
strNum = Right(.Fields("编号"), 5)
strNum = Format(Val(strNum) + 1, "00000")
strNum = Format(Date, "yymmdd") & strNum
End If
End With
txtNumber = "T" & strNum
End Sub
其中.Filter = "日期 Like '" & Date & "%'"为黄色区域
说实话本人还是个菜鸟不怎么懂过滤器这方面,有没有哪个大神来帮忙解释解释,谢谢了
VB Filter
[解决办法]
[日期] 字段不是字符串类型吧!