Required Field

  • Thread starter Thread starter Honey
  • Start date Start date
H

Honey

I have a form with a combo Box field for entering pedigree information. The
combo box has a afterupdate to automatically enter the Horse ID into the next
field. I have set the required field property to no, but it will not let me
skip this field. Any help will be greatly appreciated.

Thanks
 
My guess would be that the column has a DefaultValue property of 0, and that
referential integrity is being enforced in the relationship with the
referenced table. As no value of zero will exist in a row in that table,
referential integrity will be violated if the default value is accepted.

You have two alternative solutions. Firstly you can remove the zero
DefaultValue setting (as a rule of thumb a default value is usually
appropriate only if the Required property is True). Secondly you can add a
row to the referenced table with a value of zero in its primary key column,
and something like N/A in a text column (if the key is an autonumber column
you'll need to use an 'append' query to do this; it can't be entered
manually). The first solution is probably appropriate n your case, though
the latter is more relationally pure.

I'm not sure what you mean by "has a afterupdate to automatically enter the
Horse ID". Normally you'd just use a bound combo box, with no need for any
code in its AfterUpdate event procedure. Perhaps you could explain this in
more detail.

Ken Sheridan
Stafford, England
 
Back
Top