Dim rs As New ADODB.Recordset
If IsNull(Me.id) Or Me.id = "" Then
MsgBox "请输入要查找的 id", vbExclamation + vbOKOnly, "查找"
id.SetFocus
Else
If Not IsNumeric(Me.id) Then
MsgBox "id 为数字值, 请重输", vbExclamation + vbOKOnly, "查找"
id.SetFocus
Else
With rs
.Open "SELECT * FROM lge WHERE id=" & Me.id, CurrentProject.Connection
If .EOF And .BOF Then
MsgBox "没有找到 id 为" & Me.id & " 值的记录, 请重输 id", vbExclamation + vbOKOnly, "查找"
id.SetFocus
Else
Me.日期 = rs("日期")
Me.车辆 = rs("车辆")
Me.当日里程 = rs("当日里程")
Call SetButt("查看")
End If
End With
End If
End If