Dev,
Thanks for the further explanation.
No, as I mentioned before, the Validation on a form control does not
work like that. The validation check only is triggered if the control
is edited. So, if you simply "leave PurchaseID blank", you are not
editing the data in the control, and therefore the validation test will
not take place. If you want the validation test to take place in this
situation, you would be best to set the Validation Rule on the field in
the design view of the table, not on the form control.
The error message you are receiving would indicate that you have a
Relationship defined, with Referential Integrity enforced, between the
tblSale table and the tblPurchase table. The message is telling you
that you can't have a PurchaseID in the tblSale table unless there is a
corresponding entry in the PurchaseID field in the tblPurchase table. I
am not sure how this works in terms of how you have got your forms set
up, but a usual way of handling this situation is to have a form based
on the table on the "many" side of a relationship, in continuous view,
and place it as a subform on the form based on the "one" side table.
This will allow the value in the linking field to be automatically managed.