record level event

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
 
D

Dirk Goldgar

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top