Private Sub Text97_AfterUpdate()
CheckData
End Sub
Private Sub ชื่อtextboxของTagNoBarcode_AfterUpdate()
CheckData
End Sub 
Private Sub CheckData
Dim chk,chk2 As Variant
IF not isnull(Me.Text97) And  not isnull(Me.ชื่อtextboxของTagNoBarcode) then
chk = DLookup("[Barcode PCB]", "[TableA]", "[Barcode PCB] = '" & Me.Text97 & "' And [Tag No Barcode] = '" & Me.[ชื่อtextboxของTag No Barcode] & "'")
chk2 = DLookup("[Barcode PCB]", "[TableB]", "[Barcode PCB] = '" & Me.Text97 & "' And [Tag No Barcode] = '" & Me.[ชื่อtextboxของTag No Barcode] & "'")
    If IsNull(chk) And IsNull(chk2) Then
       MsgBox "ไม่มีข้อมูลในทั้งสองตาราง กรุณาตรวจสอบ"
       Me.Undo
    Else If IsNull(chk) Then
       MsgBox "ไม่มีข้อมูล In TableA กรุณาตรวจสอบ"
       Me.Undo
    Else If IsNull(chk2) Then
       MsgBox "ไม่มีข้อมูล In TableB กรุณาตรวจสอบ"
       Me.Undo
    Else If Not IsNull(chk) and Not IsNull(chk2) Then
      MsgBox "มีข้อมูลทั้งสองชุด"
    End If
end if
End Sub