database problem

  • Thread starter Thread starter md
  • Start date Start date
M

md

I have designed an elaborate database with many tables and
one form with many subforms that include query forms.

Some work and some don't.

The ones that don't work are driving me insane. When I go
to enter information into the subform, I manage to receive
a pop-up that says:

The change you requested to the table were not successful
because they would create duplicate values in the index,
primary key, or relationship.

What does this mean and can it be fixed?
 
The change you requested to the table were not successful
because they would create duplicate values in the index,
primary key, or relationship.

What does this mean and can it be fixed?

It means that you're trying to create a new record with a value in the
Primary Key which duplicates a record which already exists in your
table.

One way this can happen is due to Microsoft's obnoxious decision to
automatically set the Default property of all numeric fields to 0 -
which you do NOT want if that field is a primary or foreign key field!
 
Ok. I took out all the zeros, and still I get the same
message.
What do I do now?

Give us a little more information. Take one of the forms that's giving
this error; open it in design view, and find the Recordsource
property. Click the ... icon to open a query window, and go to SQL
view, and post the SQL code here.
 
SELECT [Applicant Screening].LastName, [Applicant
Screening].FirstName, [Criminal History].DUI, [Criminal
History].AccessDeviceFraud, [Criminal History].Possession,
[Criminal History].PWID, [Criminal History].Assault,
[Criminal History].SimpleAssault, [Criminal
History].AggrevatedAssault, [Criminal History].Retail,
[Criminal History].Forgery, [Criminal
History].IdentityTheft, [Criminal
History].UnauthorizedUseofAuto, [Criminal
History].FalseReports, [Criminal
History].TheftByUnlawfulTaking, [Criminal
History].WelfareFraud, [Criminal
History].CriminalConspiracy, [Criminal
History].ProbationViolation, [Criminal
History].Prostitution, [Criminal History].Paraphenellia,
[Criminal History].Robbery, [Criminal History].RSP,
[Criminal History].Escape, [Criminal
History].AttemptingtoAllude, [Criminal
History].CriminalDefiantTresspass, [Criminal
History].DisorderlyConduct, [Criminal
History].PublicDrunkeness, [Criminal
History].ForgeryWithIntent, [Criminal
History].CreditCardTheft, [Criminal
History].EndangeringWelfareofChildren, [Criminal
History].CorruptionofMinors, [Criminal
History].CriminalMischief, [Criminal
History].ResistingArrest, [Criminal
History].DrivingWithASuspendedLicense, [Criminal
History].Other1, [Criminal History].Other1Text, [Criminal
History].Other2, [Criminal History].Other2Text, [Criminal
History].Other3, [Criminal History].Other3Text, [Criminal
History].[Date Admitted to ACJ], [Criminal History].
[Probation Officer], [Criminal History].[Alternative
Housing Recommended], [Criminal History].[Juvenile
Record], [Criminal History].[Circumstances Current
Arrest], [Criminal History].[Circumstances Priors],
[Criminal History].[WeaponsArrests/Convictions], [Criminal
History].[Circumstances Weapons], [Criminal History].[Out-
of-State Arrests], [Criminal History].CrimeTypeID,
[Criminal History].PreviousCriminalHistory, [Applicant
Screening].ApplicantID
FROM [Applicant Screening] RIGHT JOIN [Criminal History]
ON [Applicant Screening].ApplicantID = [Criminal
History].ApplicantID;


This is the SQL query.
 
Back
Top