Private Sub 客户识别码_BeforeUpdate(Cancel As Integer)
1001 If Me.NewRecord = True Then '如果是新记录
1002 d = DLookup("客户识别码", "客户", "客户识别码 = '" & Me![客户识别码] & "'")
1003 If IsNull(d) = False Then
1004 MsgBox "客户识别码输入错误,新客户识别码不可与现有识别码重复," & _
"请重新输入"
1005 Cancel = True
1006 Me![客户识别码].Undo
1007 Exit Sub
1008 End If
1009 End If
End Sub
附 件:
点击下载此附件