Rodneypotter
New member
- Local time
- Today, 05:18
- Joined
- Feb 4, 2015
- Messages
- 2
HI
To start with thankyou to evryone on this forum as I have been using examples and tips to help me get to grips with access and sorry if my post is long !!
I have created loans database which is to be used for AV loans within my workplace, everything works as I want it to apart from one small bit
I have the following set up
Tables:
tblCopies
tblEquipment
tblLoans
tblUsers
Queries:
qryloan
qryoverdue
qryUserSearch
Forms:
frm_Adduser
frm_Issue
frm_LoansSub
frm_Onloan
frm_Overdue
I have created a form which allows a search to be run to find a user, this displays in a listbox, upon chosing the user the list box is cleared and hidden and the Username, Surname and Firstname are displayed in textboxes. I have a textbox where the item number is inserted and an issue button which when clicked saves the 'loan' to a table.
If I then refresh the page or choose 'design view' I am hit with the following:
'The changes you requested 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.'
This error also occurs if you select a user and prior to issuing any item click refresh/change to design view so I assume it is the username/surname/firstname trying to write back to tblUsers
I realise that this is a relationship issue but it has stumped me, the last few weeks have been a very steep learning curve in Access and I am amazed I have gotten this far
The issue/discharge code has been taken from the following example
ms-access-tips.blogspot.co.uk/ 2012/ 03/ dao-recordset-in-action-example-lending
I originally downloaded this but it took a while before I actually understood it, and once having an understanding of it I have based my issue / discharge coding on it.
I hope that what I am trying to do can be done and someone can help me remove the error.
Hopefully I have attached a zipped copy of my database.
Chris
To start with thankyou to evryone on this forum as I have been using examples and tips to help me get to grips with access and sorry if my post is long !!
I have created loans database which is to be used for AV loans within my workplace, everything works as I want it to apart from one small bit

I have the following set up
Tables:
tblCopies
tblEquipment
tblLoans
tblUsers
Queries:
qryloan
qryoverdue
qryUserSearch
Forms:
frm_Adduser
frm_Issue
frm_LoansSub
frm_Onloan
frm_Overdue
I have created a form which allows a search to be run to find a user, this displays in a listbox, upon chosing the user the list box is cleared and hidden and the Username, Surname and Firstname are displayed in textboxes. I have a textbox where the item number is inserted and an issue button which when clicked saves the 'loan' to a table.
If I then refresh the page or choose 'design view' I am hit with the following:
'The changes you requested 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.'
This error also occurs if you select a user and prior to issuing any item click refresh/change to design view so I assume it is the username/surname/firstname trying to write back to tblUsers
I realise that this is a relationship issue but it has stumped me, the last few weeks have been a very steep learning curve in Access and I am amazed I have gotten this far

ms-access-tips.blogspot.co.uk/ 2012/ 03/ dao-recordset-in-action-example-lending
I originally downloaded this but it took a while before I actually understood it, and once having an understanding of it I have based my issue / discharge coding on it.
I hope that what I am trying to do can be done and someone can help me remove the error.
Hopefully I have attached a zipped copy of my database.
Chris