Tables / Queries Duplicating Data (1 Viewer)

Gismo

Registered User.
Local time
Today, 17:47
Joined
Jun 12, 2017
Messages
1,298
Hi All,

Hope all is well.

I have a weird scenario where some users does some action, not sure yet as to what, where in some instances some data is duplicated, when I don't have any query designed to do so, as far as I know, unless I have a Update or Append query, where I did not notice the error
The problem is, it does not happen every time someone does does through the menu options

another issue I have is, I have a table with set detail for my different registrations
Sometimes the registration is change yo another already exiting registration, which should not be duplicated, and once again, there is no query designed to do so

Do you have any suggestion on how to find out which action causes this?

Is there a way to see which query is no where used in any action (Which could have been created and decommissioned at some time as development went and never deleted)

Not sure if this makes any sense but somewhere there is a query from all 89 query's that causes the issue and I went through each on to see if i could spot the error
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 10:47
Joined
Feb 19, 2002
Messages
43,257
Phantom records whether they are duplicates or not are usually created by your own code. Check the forms that update the table(s) in question and make sure that you do NOT have any code that is dirtying the form in the Current, Load, or Open events. Remember, Access ALWAYS saves a dirty record when you leave it and if you do not have the proper validation code in the form's BeforeUpdate event, and proper Referential Integrity set up on the tables, you can't stop it.

If you show the record selectors, you will have a visual clue. Does the pencil show when the form opens before anyone types anything? If it does, your code has already dirtied the record and Access will be hell bent on saving it unless you stop it in the BeforeUpdate event with good validation.
 

Gismo

Registered User.
Local time
Today, 17:47
Joined
Jun 12, 2017
Messages
1,298
Phantom records whether they are duplicates or not are usually created by your own code. Check the forms that update the table(s) in question and make sure that you do NOT have any code that is dirtying the form in the Current, Load, or Open events. Remember, Access ALWAYS saves a dirty record when you leave it and if you do not have the proper validation code in the form's BeforeUpdate event, and proper Referential Integrity set up on the tables, you can't stop it.

If you show the record selectors, you will have a visual clue. Does the pencil show when the form opens before anyone types anything? If it does, your code has already dirtied the record and Access will be hell bent on saving it unless you stop it in the BeforeUpdate event with good validation.
I am not sure from which form the duplication comes from so not even sure where to start looking for the error code
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 10:47
Joined
Feb 19, 2002
Messages
43,257
Do you know which form is bound to which table? If so, that is where you start. Look for code in the Current, Open, and Load events. Those are usually the culprets.
 

Users who are viewing this thread

Top Bottom