Subform and Before Update

  • Thread starter Thread starter John S
  • Start date Start date
J

John S

Back again,

I have a subform (a continuous form) on which I do validation on various
fields via a beforeupdate function in the subform itself. It works fine,
except for one annoying problem: every time I begin an entry in the subform,
it triggers the sub-form's "before update" function (and the validation).
What appears to be happening is that as soon as I enter the subform, a
second (blank)subform record (or at least row) is created. This is actually
visible(the subform shows two rows, the second having a star at the
beginning).

Is there a way around this problem, or do I simply have to give up using the
before update validation on the subform?

Thanks

John S.
Aylmer, PQ
 
Beginning to enter a new record should trigger Form_BeforeInsert, but it
should not trigger Form_BeforeUpdate. The presence of the extra row after
Form_BedoreInsert has nothing to do with the Form_BeforeUpdate event.

Is the subform based on a query that contains more than one table? This can
cause Form_BeforeUpdate to trigger. Temporarily change it to a table and see
if this makes a difference.

Don't give up on Form_BeforeUpdate for record validation.
 
You could use the beforeupdate event of one of the fields. That way it only
fires when that field has information changed in it.
 
Back
Top