Table / relationship / Error 3022 query - any help appreciated! (1 Viewer)

Accessnewbie1981

New member
Local time
Today, 05:51
Joined
Nov 23, 2016
Messages
1
Hi,

I was wondering if anyone can help me, as I've been trying to find a solution to this issue for two days with no joy! I'm not totally sure if I'm posting in the correct forum as this could possibly be a form problem, but I'm 80% sure it's a table / relationship issue due to the error message (3022) that pops up "The changes you requested to the table were not successful because they would create duplicate values in the index, primary key, or relationship. Change the data in the field or fields that contain duplicate data, remove the index, or redefine the index to permit duplicate entries and try again."

Basically I've set up an Access db (Access 2013) to log answers from two questionnaires for a project we are undertaking - the questionnaires ask mostly the same questions to gauge the difference in knowledge pre- and post- an intervention. The 'Pre' and 'Post' questionnaires have been set up as two different tables. The ID number (not the auto number) will be the same for each set of pre/post questionnaires, and has been set up as the primary key and is linked via a one-to-one relationship, and I have enforced the referential integrity.

I set up forms based on these tables. The main form is the 'Pre' data, and within a tab I have added the 'Post' form as a subform. I'm able to enter data perfectly into the 'Pre' form, and it saves to the table and stays in the form, but when I enter data into the 'Post' form and try and save or switch between tabs, or move to new record I get the error message above. I can't understand why this message occurs, although it could be quite simple as my Access skills are really not very advanced at all! I've tried removing the Primary Key, allowing duplicates within the Index, removing the relationship, renaming all fields within the 'Post' table so that they all started with a prefix... but nothing has seemed to work.

Does anyone have any ideas on what I have done to cause this issue, and how I can fix it?

Please let me know if I need to provide any further information, or if it would be useful to see the database.

Thank you in advance!
 

Ranman256

Well-known member
Local time
Today, 00:51
Joined
Apr 9, 2015
Messages
4,337
This error is vb code error for an object that was not created.
Since you did not provide the spot where the error occured, its hard to proceed any further.

What did you do when it threw the error ?
Any code where the error happened?
 

Users who are viewing this thread

Top Bottom