Subform control

  • Thread starter Thread starter edtollefsen
  • Start date Start date
E

edtollefsen

I have the following situation:
* form and subform tied together with a field called
invoiceDate.
* form has data from one table
* subform has data from another table. This data
has a 1 to many relationship with the table used in the
form.

If I update invoiceDate from the form the data in the
subform changes appropriately however as soon as I go to
the subform the system throws an error message indicating
data already exists (see below for actual message).
There are 3 circumstances that may happen.


"The changes you requested to the table were not
successful because they wold create duplicate values in
the index, primary key, or relationship. Chang 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."
 
My guess is that you have some automatically-executing
code (perhaps in the Current, or Activate event) of the
Form in the Subform control, or in the Before or After
Update event of the main Form that is trying to write a
new Record to the Table using the information from the
existing Record that is displayed.

There's certainly nothing _inherent_ about entering a the
Form embedded in a Subform Control that would cause such
an error.

In any case, such code is what I'd first look for in
debugging.

Larry Linson
Microsoft Access MVP
 
Back
Top