Required data on subforms

  • Thread starter Thread starter Rob M
  • Start date Start date
R

Rob M

Hi group,

I have an Access parent form with two subforms. I'm wondering whether
there's a way to "force" people to enter data on one field in each
subform, or else not save any data (parent data included) at all.

If it's relevant, the parent form is supplied by a query. Each
subform is supplied by its own table. Each table is linked to the
parent query by a unique primary key.

I'm able to detect incomplete subform data using the BeforeUpdate
event on the parent form. But I'm not sure what to do from there.

I'd be very grateful for any help!

Thanks,
Rob
 
Due to how Access handles data, what's been keyed in the parent form will
be saved before the user starts to key anything on the subform. The only way
to achieve what you're trying to do would be to have logic that deletes the
row from the parent table if nothing's added on either subform. If this is a
single-user application, you could achieve this by writing a Delete query
that deletes any rows in the parent table that have no children, and run
that query when you exit the parent form (or even on the Current event of
the parent form).
 
Thanks Doug. That explains a lot. I think it's back to the drawing
board with this idea...

Cheers,
Rob
 
Back
Top