Good morning,
I'm running an append query as part of a stack of queries in a macro. The data that the append query is retrieving comes from a much older system that contains the occasional instance of records with matching ID fields. In such cases, it isn't feasible for us to find which is the correct one and thus we are happy to just ignore both records whenever this happens. But we still want the rest of the data to be appended into a table in the current Access database. When the query is run, an error message is displayed informing me that:
"Microsoft Access can't append all the records in the append query"
If I press the 'Yes' button on this message box, only the records with unique key fields are appended to the destination table; which is exactly what is desired. My question is: can this process be automated? That is, can I capture this message box using an error trap and select 'Yes' as my response using VBA code, so that I could call it in the macro to prevent the button having to be pressed using the cursor?
Thanks for any help you can offer,
Matthew
I'm running an append query as part of a stack of queries in a macro. The data that the append query is retrieving comes from a much older system that contains the occasional instance of records with matching ID fields. In such cases, it isn't feasible for us to find which is the correct one and thus we are happy to just ignore both records whenever this happens. But we still want the rest of the data to be appended into a table in the current Access database. When the query is run, an error message is displayed informing me that:
"Microsoft Access can't append all the records in the append query"
If I press the 'Yes' button on this message box, only the records with unique key fields are appended to the destination table; which is exactly what is desired. My question is: can this process be automated? That is, can I capture this message box using an error trap and select 'Yes' as my response using VBA code, so that I could call it in the macro to prevent the button having to be pressed using the cursor?
Thanks for any help you can offer,
Matthew