Design a Macro for Duplicate Required

creat!ve

New member
Local time
Today, 15:40
Joined
Sep 26, 2012
Messages
6
Hi All,

Having made sufficient attempts i couldn't get duplicate finding macro up & running. Can somebody design it for me?

I know there is a pre-defined query in place to find duplicate & im using the same all this while but now i think i need to automate it. Hence, any help with this regard is appreciated.

I've attached spread sheet which has data( raw data in "Testing" tab & expected results in "Result" tab) & Access sheet as well.

Please help!! ;)

Please let me know if you need any other info from my end.

Cheers,
Creat!ve
 

Attachments

If you have a find duplicate query in place and is working fine then what you need is just to press a button and that button should run that query. Is this what may be OK with you.

If yes,

Create a command button and before that keep "Use Control Wizard" activated in controls and then when you create a button automatically Command button wizard shall activate and then select Miscellaneous and then Run query. Choose your desired query then. This process shall basically create a macro bound to this button which you can see later.

Hope this helps.
 
Sorry but i didnt get that :banghead:, would it be possible for you to break it down further?

thanks mahenkj2
 
Sorry but i didnt get that :banghead:, would it be possible for you to break it down further?

thanks mahenkj2

Create a blank form:
Step -1
Click create >>> Form Design
Step -2
In form design, click on the command button on the design menu and then click on form design surface, click cancel button.
Step -3
double the command button and open the VBA code design window
Step -4
On button click event, copy and paste the following code:
Code:
Private Sub Command0_Click()
DoCmd.OpenQuery "YourQueryName"
End Sub

hope this guide you how to call your query by clicking a command button on the form.
 
Hi Khalid_Afridi,

Im currently using default query wizard which is inbuilt in Access can i still proceed further & use it? I'll definitely giev it a try for sure.


Hi mahenkj2,

Im using inbuilt wizard to find duplicate.
Please accept my apologies i should have conveyed it before.

Thanks a heap :)
 
Hi mahenkj2,

Im using inbuilt wizard to find duplicate.

OK, so did you save that query. What is the name of the query?

Since you posted in Macro forum, there are both methods available to open a query. One may be with macro, second is VBA and both are easy to implement.

In case you have more troubles in doing what I and others suggested, better you post your sample with what you want.

regards.
 
OK, so did you save that query. What is the name of the query?

Since you posted in Macro forum, there are both methods available to open a query. One may be with macro, second is VBA and both are easy to implement.

In case you have more troubles in doing what I and others suggested, better you post your sample with what you want.

regards.

Sorry could not revert back to your post infact was out of town.
Will do & share that with you ASAP.
 
OK, so did you save that query. What is the name of the query?

Since you posted in Macro forum, there are both methods available to open a query. One may be with macro, second is VBA and both are easy to implement.

In case you have more troubles in doing what I and others suggested, better you post your sample with what you want.

regards.


Hi mahenkj2,


thanks for your help.
Please find the attached access sheet which has the query saved in it.


Cheers
 

Attachments

Please find attached dB. I made a form and created buttons showing both methods i.e. by Macro as well as VBA.

Hope it helps.

regards.
 

Attachments

creat!ve
you have done already to find duplicate records using sub-query:

SELECT Testing.VendorName, Testing.InvoiceAmt, Testing.InvoiceNumber, Testing.InvoiceDate, Testing.CurrencyCode
FROM Testing
WHERE (((Testing.VendorName) In (SELECT [VendorName] FROM [Testing] As Tmp GROUP BY [VendorName],[InvoiceAmt] HAVING Count(*)>1 And [InvoiceAmt] = [Testing].[InvoiceAmt])))
ORDER BY Testing.VendorName, Testing.InvoiceAmt;

Now you can Run it by clicking a Command Button click event: (powerful and flexible action)
Docmd.OpenQuery"criteria 1"

OR

By Clicking a command button Click Macro action (default click method of command button by creating a macro action - not very powerful and limited action)
 
update; i did test your earlier upload with real data & it worked like charms....thanks a ton buddy...appreciate your assistance.

One other request mahenkj2, if you could incorporate it in the above Updated Testing.accdb which you have sent/uploaded.
1. Can we please do something like this --- 2 diff dropdown wherein the user sets his/her choice & determines which fields are to be tested?
2. Can we get all the test output in spread sheet? (excel)
 

Users who are viewing this thread

Back
Top Bottom