请问这段VB代码有什么错误

来源:百度知道 编辑:UC知道 时间:2024/07/04 11:46:03
为什么我运行程序时,我点击的MSFlesGrid控件里的数据它显示“实时错误'3265' Item not found in this collection 然后我点“调试” 它就指向下边这段代码:
MsgBox "选择的车号为" & rs![LicensePlate] & "vbcrlf" & "停车时间启始于" & rs![In Time] & "vbvrlf", vbInformation + vbOKOnly, "车辆信息"
这是MSFlesGrid控件里的代码:
Private Sub MSFlexGrid1_Click() '查询车辆的停车数据
Dim txt1, txt2 As String
'组合查询字符串
txt1 = "Floor=" & MSFlexGrid1.Row
txt2 = "Grid=" & MSFlexGrid1.Col
txt1 = txt1 & " And " & txt2

rs.FindFirst txt1 '进行搜寻
If Not rs.NoMatch Then '找寻到数据后,显示停车数据

MsgBox "选择的车号为" & rs![LicensePlate] & "vbcrlf" & "停车时间启始于" & rs![In Time] & "vbvrlf", vbInformation + vbOKOnly, "车辆信息"

End If

End Sub

不明白,代码呢
-----------------------------
改成下面的试试:
MsgBox "选择的车号为" & rs![LicensePlate] & "vbcrlf" & "停车时间启始于" & rs![In Time] & "vbvrlf", "车辆信息"
, vbInformation + vbOKOnly