View Single Post
  #2  
Old November 6th, 2009, 07:32 PM posted to microsoft.public.access.forms
Douglas J. Steele[_3_]
external usenet poster
 
Posts: 3,143
Default Required data on subforms

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).

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)


"Rob M" wrote in message
...
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