Update form based on subform

  • Thread starter Thread starter Max Moor
  • Start date Start date
M

Max Moor

Hi All,
This is probably a dead simple thing, but I'm stuck on it.

My main form's record set is dependent on the selection of a record
from one of its subforms. When the user selects a different record, I need
to requery the main form to update all the other stuff on it that refers to
the selected record in the subform.

What is the simplest way to detect that a user has selected a different
record in the subform?

In the past, I've setup OnClick events for all the subform's controls.
That's seems a lot of redundancy. I've seen a number of form events that
look like they would, but are only work on pivot tables. The form's OnClick
only happens if the record selector is clicked, and the detail section's
OnClick doesn't seem to do anything. Isn't there a really simple way to do
this?

- Max
 

Hi Allen,
My thing is similar to the examples on the website, but not quite. I
have a combobox in the form header, from which a supplier can be selected.
One subform (continious forms) then shows the products acquired from that
supplier. I use a subform there so the main product info can be edited right
there. The rest of the form shows more detailed information for which ever
product is selected in the product subform. The SQL for the mainform uses a
value in the subform's currently selected record as a criteria. So I have
is:

cboSupplier -> fsubProduct -> frmMain (product details)

I guess it looks a little screwy, but it sure works well. The downside
is having OnClick event code for every control on the subform, just to detect
that there has been a record selection change.

What I'm trying to figure out if there is a simpler mechanism for
detecting the selection change in the subform, so I can requery the main
form. The AfterUpdate for the subform is close, but only happens if data in
a control changes.

- Max
 
The SubForm Current event fires every time there is a record selection change.
 
Back
Top