NauticalGent
Ignore List Poster Boy
- Local time
- Today, 03:48
- Joined
- Apr 27, 2015
- Messages
- 6,754
Good evening AWF,
I was looking for a solution to remove duplicate records from a temp table prior to appending/updating the master table.
I found this solution here:
http://mobile.databasejournal.com/f...lete-Duplicate-Records-From-Access-Tables.htm
To test this, I loaded the table with some known duplicates and called the sub from the Immediate Window. It worked like a charm and I was pleased as punch.
I made the sub public and placed the "call code" within the forms module. I did not get the results I was hoping for and started trouble-shooting. Couldn't see anything obvious so I did what I should have done to begin with and removed the On Error Resume Next and put in an error handler, complete with a Msgbox with the error description. Complied and ran the code again...
I got a Msg box with no error, clicked "ok" and then checked the results...which were correct. In other words, the code deleted the dup records in spite of triggering the error handler. Even the Debug.Print was empty. Strange...
I loaded the table again with the control data, commented out the Msgbox portion of the error handler and ran the code again...and got the results I was looking for.
I am using Access 2010, windows 7. I guess I should just be happy that the code is working, but I am curious as to why this is behaving the way it is.
Anyone have any similar experiences like this, or an idea why it is throwing blank errors?
Thanks in advance!
I was looking for a solution to remove duplicate records from a temp table prior to appending/updating the master table.
I found this solution here:
http://mobile.databasejournal.com/f...lete-Duplicate-Records-From-Access-Tables.htm
To test this, I loaded the table with some known duplicates and called the sub from the Immediate Window. It worked like a charm and I was pleased as punch.
I made the sub public and placed the "call code" within the forms module. I did not get the results I was hoping for and started trouble-shooting. Couldn't see anything obvious so I did what I should have done to begin with and removed the On Error Resume Next and put in an error handler, complete with a Msgbox with the error description. Complied and ran the code again...
I got a Msg box with no error, clicked "ok" and then checked the results...which were correct. In other words, the code deleted the dup records in spite of triggering the error handler. Even the Debug.Print was empty. Strange...
I loaded the table again with the control data, commented out the Msgbox portion of the error handler and ran the code again...and got the results I was looking for.
I am using Access 2010, windows 7. I guess I should just be happy that the code is working, but I am curious as to why this is behaving the way it is.
Anyone have any similar experiences like this, or an idea why it is throwing blank errors?
Thanks in advance!