record level event

  • Thread starter Thread starter Dick Minter
  • Start date Start date
D

Dick Minter

I have a form with two subforms. I want to update a field
in subform 1 when the value changes (or is added or
deleted) in a field in subform 2. The problem arises when
a subform 2 record is deleted. Access doesn't appear to
have a "record object," so what form event do I use to
capture the current value of the subform 2 field in
question so that I can use it in the subform 1 update
formula after the confirm delete form event fires?

DM
 
Dick Minter said:
I have a form with two subforms. I want to update a field
in subform 1 when the value changes (or is added or
deleted) in a field in subform 2. The problem arises when
a subform 2 record is deleted. Access doesn't appear to
have a "record object," so what form event do I use to
capture the current value of the subform 2 field in
question so that I can use it in the subform 1 update
formula after the confirm delete form event fires?

DM

Capture the value from the form control in a form-level variable in the
form's Delete event. The Delete event will fire for each record
deleted. If the form is displayed in continuous forms view or datasheet
view, the user can delete multiple records in one operation, so you'll
probably need to actually compile a collection or a delimited list of
the values from all the deleted records, then clear this list in the
AfterDelConfirm event when you're done with it.
 
Back
Top