Find Duplicates Query Datasheet Won't Close

Hey Lucy

Registered User.
Local time
Today, 07:37
Joined
Jan 20, 2012
Messages
124
I have a strange situation here that may be hard to explain.

I have a Find Duplicates query that I created with the Query Wizard.

IF I run the query and find duplicates, I can close the resultant datasheet with the close button.

IF I run the query and find duplicates and delete them, I can close the resultant datasheet with the close button.

IF I run the query after I have found and deleted duplicates and closed the window, I can close the resultant datasheet (with no records) with the close button.

BUT IF I run the query when there are no duplicates, it opens the datasheet with no records, but you can't close it with the close button. You have to exit the database completely.

Any ideas here? I don't know SQL or VB. Have to do this in Access.

I thought about creating an If statement in a macro, but am not sure of the syntax, but this would be the basic statement I would make:

IF Find Duplicates query returns no records,
THEN Cancel Event.
End IF

Any and all help will be greatly appreciated! Thanks!
 
perhaps the query is still running, perhaps an endless loop?
ofcourse I don't know what your query and macros look like but I think you're thinking in the right direction. when no duplicates are found, don't show an empty resultset. in vba this problem would be easy to fix.

perhaps you can post a sample database?

HTH:D
 
I actually found an effective work-around.

I created the Find Duplicates Query, then created a form in datasheet view based on the query. No problems!

Also, the Find Duplicate Query results (when there were any) would not allow deletions from the resulting recordset. It would say it had deleted it, but when you pull up the main table, the duplicate would still be there, and when you ran the query again, it would be back there, also.

I've seen a lot of people ask about that and found out that it was a bug in Access. By creating a datasheet form based on the query, it DOES actually delete the selected data, so this solved two problems!

Thanks for your input!
 

Users who are viewing this thread

Back
Top Bottom