records in subform

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Here is the problem:

I have a main form with a combo box to choose client.

A subform displays all events relating to the chosen client.

For ONLY ONE of those clients, I am allowed to edit data in the subform.
For the rest I get the error msg "The changes you requested to the table were
not successful because they would create duplicate values in the index,
primary key or relationship."

The only thing that separates the ONE client's events (that I can edit in
the subform) from the others, is that is the first in the list. Otherwise it
should operate no differently from all the other clients.

RELATIONSHIPS: My Client table (mainform) has a 1 to many relationship with
the event table (subform).

INDEXES:
My client field in the client table is indexed: Yes (No Duplicates)
My client field in the events table is indexed : Yes (Duplicates OK)

PRIMARY KEYS:
Client table: Client
Event table multifield Primary key (not including client)

All the Primary Keys are required fields and so are filled in on all
records. The link child / master fields are identified in the properties of
the subform (Client). The linking field (client) is populated on both forms
and there is a control on the main form and the subform with the values held
in it. I have researched this on the web and there seems to be a bug in
Access 2003 with this error msg but I am using Access 2002.

Perhaps the problem is because my Primary key in the Event Table is
[ProposalNo] + [EventNo] both indexed as duplicates OK, although obviously
each combination is unique. Could the subform object to both being indexed
as duplicates OK?

I can manually add onto the table for all clients, so the problem must be in
the form/subform. Is there something I am missing to do with the fact that
the first client in the list (ie the one which the combo box defaults to
showing upon opening the form) can be edited and the others cannot?

PLEASE HELP!!!!!
Thank you!!
 
I think I see a problem. Backup your database and then modify the Event
table multifield Primary key to include client.

You may have the same type of events on same day (assuming these datafields
are your multifield key) for more than one client. Without client being a
part of the multifield key you can not enter the second event.
 
Hi Karl

Thanks so much for your help. I tried this but am still getting the same
error msg. The type of event and date are not my multifield primary key so
perhaps this is why. My multifiled Primary key is [Proposal No] + [Event No]

I am so intreugued as to why the events (in the subform) belonging to the
first client in the list (in the mainform) can be succesfully edited, and the
others cannot.

Even if I select say the 3rd client from the list - try to edit it - fail &
get error msg, then go back to the first client in the list I AM able to edit
it once again. Is there something to do with the fact that when the form
opens, the first client is displayed in the combo box has a special property
which makes it the only one I can edit?

Thanks again
 
Back
Top