如果在数据表设成不能重复的 就可以用错误捕捉 
On Error Resume Next
 ..........
     If Err = -2147467259 Then
       MsgBox "重复,请重写", 48
     end if