Subforms

  • Thread starter Thread starter Dorian Chalom
  • Start date Start date
D

Dorian Chalom

I have a form-Subform based off of two tables, Form and Sub Form. How do I
make sure a corisponding record is created in SubForm when a record is added
to Form?
 
Dorian said:
I have a form-Subform based off of two tables, Form and Sub Form.
How do I make sure a corisponding record is created in SubForm when a
record is added to Form?

You can't very easily. It is a requirement that the record in the main form
be saved prior to allowing a record in the subform to be created. After
creating the parent and before creating the child, the user can close the
form, or lose power, or reset his PC (or lots of other things).

You can use code to test for lack of a child when he tries to close the form
or navigates off the record (if you provide your own navigation methods),
but you cannot prevent a lot of the other ways that a childless parent
record could be created. The best you can do is create an audit routine
that finds any such records and deletes them (or at least alerts you to
their existence).
 
Back
Top