Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim cmdStr As String
' On Error GoTo DealError
'使用输入的名称执行查询
Dim objCn As New ADODB.Connection
Dim objRs As New ADODB.Recordset
Set objCn = CurrentProject.Connection
If objCn.State = adStateOpen Then
'MsgBox "mdb已经打开"
ElseIf objCn.State = adStateClosed Then
objCn.Open
End If
Dim Com As New ADODB.Command
cmdStr = "select * from 车辆基本信息表 where 牌照号='" & Me.牌照号 & "'"
Dim c1 As String
objRs.CursorType = adOpenStatic
If objCn.State = adStateOpen Then
objRs.ActiveConnection = objCn
objRs.Open cmdStr
End If
If objRs.RecordCount >= 1 Then
'更新数据库