Assign a button to duplicate records

fixemup27

Registered User.
Local time
Today, 09:50
Joined
Feb 23, 2012
Messages
11
I would like to be able to click a button in Microsoft Access and have it find and give the option to delete records within a split form.

Ex: I click the button, a prompt shows up with any duplicates found and further prompts me to delete, if no duplicates are found it a message box will state "No duplicates found". I would like to assign a VBA to a button if possible. Can anyone help..Thank you...I am trying to do this without having to use the ribbon for business purposes.
 
I like to use a ListBox for this kind of thing. It allows for multi-select which is what the user will expect.

It's fairly simple to do but it requires a fair amount of time setting it up so I won't have time to code it for you but I can give you the steps you need to do to accomplish it.

Set your code up like this:
1)when the user clicks your button, build a recordset to find all the duplicates in the table (I like to cheat and use the dreaded Access Query Wizard to base a "find duplicates" query on)
2)If there are no records in your recordset, show the "no dups" message, otherwise, open a form you have made specifically for deletion. This form should have a ListBox, a Delete button and a Cancel button
3)If the user clicks Delete, loop through each of the items the user selected, then requery the ListBox to show what duplicates (if any) are left
4)If the user clicks Cancel, just close the form.

If you need help figuring any of those steps out let me know.
 

Users who are viewing this thread

Back
Top Bottom