title: MsgBox and SQL 'Insert Into' query
body: <p>In a MS-Access DB I have the below SQL query fired from a VBA module that appends a record given the conditions stated in the WHERE clause. My question is, can I insert a MsgBox that informs the user if the record already exists or weather is a new record? Currently the query will append a record if the value for the field called 'Counterparty ID' is already in the destination table, and won't if not. While the mechanics are correct, I would like to notify the user whether he/she has tried to insert a duplicate record. Is this somehow possible? I assume it would have to happen within the query itself.</p>
  
  <pre><code>"INSERT INTO Netting_Determinations_List ([Counterparty ID], [Counterparty Name], [Counterparty Type], [Counterparty Subtype],[DTCC_AVOX_Registered_LEI_CICI], " &amp; _
          "[Data Point 1],[Data Point 2],[Data Point 3],[Data Point 4],[Data Point 5], [Matrix Legal Form], [Matrix Governing/Authorizing Power], " &amp; _
          "[OnBoardings Color Determination], [Matrix Clarification],  [Audit_Append_User], [Audit_Append_Date], [Audit_Append_Time]) " &amp; _
          "SELECT Repository_Redux.[Counterparty ID], Repository_Redux.[Counterparty Name], Repository_Redux.[Counterparty Type], Repository_Redux.[Counterparty Subtype], Repository_Redux.[DTCC_AVOX_Registered_LEI_CICI], " &amp; _
          "[Forms]![Frm_Master_Form]![Txt_Input_1] AS [Data Point 1], [Forms]![Frm_Master_Form]![Txt_Input_2] AS [Data Point 2], " &amp; _
          "[Forms]![Frm_Master_Form]![Txt_Input_3] AS [Data Point 3], [Forms]![Frm_Master_Form]![Txt_Input_4] AS [Data Point 4], " &amp; _
          "[Forms]![Frm_Master_Form]![Txt_Input_5] AS [Data Point 5], [Forms]![Frm_Master_Form]![Cbo_LegalForm] AS [Matrix Legal Form], " &amp; _
          "[Forms]![Frm_Master_Form]![Cbo_Status] AS [Matrix Governing/Authorizing Power], [Forms]![Frm_Master_Form]![Txt_Color] AS [OnBoardings Color Determination], " &amp; _
          "[Forms]![Frm_Master_Form]![Txt_Matrix_Clarification] AS [Matrix Clarification], '" &amp; strUsername &amp; "' AS [Audit_Append_User], " &amp; _
          "'" &amp; StrDate &amp; "' AS [Audit_Append_Date], '" &amp; StrTime &amp; "' AS [Audit_Append_Time] FROM Repository_Redux " &amp; _
          "WHERE Repository_Redux.[Counterparty ID] IN (" &amp; strCriteria &amp; ") AND NOT EXISTS (SELECT [Counterparty ID] FROM Netting_Determinations_List WHERE [Counterparty ID] = (" &amp; strCriteria &amp; "))"
  </code></pre>