No Duplicate Fields in Subform

  • Thread starter Thread starter DEI
  • Start date Start date
D

DEI

I have a subform in Datasheet format with 5 fields making
up each record. I would like to prohibit the duplication
of one of those fields on the subform when it is attached
to the mainform, i.e. I will need to enable duplicates of
this field in the subform itself (same field attached to
different records of the main form).

I do have an autonumber primary key field for each record
in the subform, but the records in each subform are
updated over time and will not register as a duplicate
record right away, hence the need for preventing duplicate
fields.

Does this require code?

Thanks in advance.
 
I have a subform in Datasheet format with 5 fields making
up each record. I would like to prohibit the duplication
of one of those fields on the subform when it is attached
to the mainform, i.e. I will need to enable duplicates of
this field in the subform itself (same field attached to
different records of the main form).

I do have an autonumber primary key field for each record
in the subform, but the records in each subform are
updated over time and will not register as a duplicate
record right away, hence the need for preventing duplicate
fields.

Does this require code?

I'm not sure I understand what you mean. You want to "prohibit the
duplication of one of those fields on the subform when it is attached
to the mainform" but "enable duplicates of this field in the subform
itself". It sounds like you want to simultaneously prohibit and enable
duplicates!

If - as I'm guessing - you mean that you want the field to be unique
within those records related to the mainform by a Foreign Key field,
simply create a unique Index on the Foreign Key (the field used as the
Child Link Field on the subform) and the field you're trying to
constrain.
 
Back
Top