Private Sub Barcode_PCB_AfterUpdate()
Dim strTAG as string
Dim wisroot As String
Dim str1 As String
strTAG = me.[TAG IMM]
wisroot = Me.[Barcode PCB].Value
str1 = "[Barcode PCB]=" & "'" & wisroot & "'"
If Me.[Barcode PCB] = DLookup("[Barcode PCB]", "dbo_ZHJ01", str1) Then
MsgBox "ข้อมูลซ้ำกัน"
Me.Undo
Else
End If
Docmd.save
Docmd.gotorecord,,acnewrec
Me.[TAG IMM] = strTAG
End Sub