Required input on subform, how to do?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Dear all,

I'm having a problem which I expect has a very simple solution.

I have a form with a subform, for each form record it must be mandatory to
enter at least one record in the subform.

How can I do this?

Thanks in advance!!

Regards,

Michel
 
You have a chicken and egg problem: There must be a record in the main form
*before* you can have a related record in the subform. It follows that you
cannot require a record in the subform before you accept one in the main
form.

One workaround is to use the AfterInsert event of the main form to execute
an Append query statement to add a record to the subform's table.

If you are desperate, you could use a pair of temp tables and enter the
records into those table, and then, only after verifying that you have both
the primary record and related record(s), write them to the true tables.
 
Back
Top