Update query errors

  • Thread starter Thread starter pn
  • Start date Start date
P

pn

I am trying to run a query that will update approx 2000
records in a table but I'm getting an error that 420
records were not updated due to Validation Rule
violations. I don't have any validation rules on the 3
fields. My code is:
UPDATE tblM1 INNER JOIN tblC1 ON tblM1.PartID =
tblC1.PartID SET tblM1.CField1 = [tblC1].[Field1],
tblM1.CField2 = [tblC1].[Field2], tblM1.CField3 = [tblC1].
[Field3];
There are cases where there's data in tblC1.Field1 but not
in Field2 or 3. Could this be a factor?
 
I don't have any validation rules on the 3
fields. My code is:
UPDATE tblM1 INNER JOIN tblC1 ON tblM1.PartID =
tblC1.PartID SET tblM1.CField1 = [tblC1].[Field1],
tblM1.CField2 = [tblC1].[Field2], tblM1.CField3 = [tblC1].
[Field3];
There are cases where there's data in tblC1.Field1 but not
in Field2 or 3. Could this be a factor?

Yes, if Field2 or Field3 are Required in tblM1. You'll get the
validation rule error even though the only error is that you didn't
add any value.
 
It could be if your tblM1 fields won't allow null values. Or if if won't allow
zero-length strings and tblC1 fields do.

Or if you have a unique index on one of the fields in tblM1 and are trying to
put in duplicate values (such as multiple nulls)
 
Back
Top