Dim rs As New ADODB.Recordset rs.Open "tbl凭证记录", CurrentProject.Connection, adOpenKeyset, adLockPessimistic rs.Find "ltrim(month([日期])))=" & LTrim(xzyf) And "ltrim([凭证号])=" & LTrim(srhm) If IsNull(rs) Then MsgBox "系统中没有此记录,请重新查询!", 48, SoftName Exit Sub Else If MsgBox("您确定要删除【" & xzyf & "月份" & srhm & "号凭证】吗?", vbYesNo + 32, SoftName) = vbYes Then rs.Delete rs.Update End If End If rs.Close Set rs = Nothing