Private Sub 客户简称_BeforeUpdate(Cancel As Integer)
Dim conn As New ADODB.Connection
Set conn = CurrentProject.Connection
Dim rst As New ADODB.Recordset
Dim msg As String
Dim ml As String
Dim strCriteria As String
rst.Open "客户资料", conn, adOpenKeyset, adLockOptimistic
strCriteria = "[客户简称]=" & Me![客户简称] & ""
If rst.EOF Then
Cancel = 0
Else
msg = "你输入客户简称已存在,请修正!"
m = MsgBox(msg, vbExclamation)
Cancel = 1
End If