主题:DAO查询问题
查询代码如下:
Dim RS1 As Recordset
Dim DB1 As Database
Set DB1 = OpenDatabase(App.Path & "\" & "db.MDB")
Set RS1 = DB1.OpenRecordset(Name:="设备维修管理", Type:=dbOpenDynaset)
RS1.FindFirst "单据编号='" & Text1.Text & "'"
If Data1.Recordset.NoMatch Then
MsgBox "没有此记录"
RS1.Close
Exit Sub
运行后,查询时就出错,
提示:“标准表达式中数据类型不匹配”
指向 “RS1.FindFirst "单据编号='" & Text1.Text & "'"”
到底怎么回事,请大家指导一下,谢谢!
Dim RS1 As Recordset
Dim DB1 As Database
Set DB1 = OpenDatabase(App.Path & "\" & "db.MDB")
Set RS1 = DB1.OpenRecordset(Name:="设备维修管理", Type:=dbOpenDynaset)
RS1.FindFirst "单据编号='" & Text1.Text & "'"
If Data1.Recordset.NoMatch Then
MsgBox "没有此记录"
RS1.Close
Exit Sub
运行后,查询时就出错,
提示:“标准表达式中数据类型不匹配”
指向 “RS1.FindFirst "单据编号='" & Text1.Text & "'"”
到底怎么回事,请大家指导一下,谢谢!