> I have a data sheet with a subform; each time the user clicks on the
"+" to show the subform, I want some code to run. I tried attaching
the code to a wide variety of events, but at best they only ran the
first time the subform popped up.
How can I get the desired behavior? Is there an event I missed or is
it more complex?
Responding to my own post here. After messing around with events, I
could not find a way to do either of the above, so instead I
implemented them manually and they appear to work.
Here's what I did:
1) I overrode the OnClick event of every data control in the datasheet
form. Each override did the same thing -- it spawned another form.
Any information to be communicated to the form was stored in a
temporary table.
2) I overrode the spawned form's Load event to pick up the data from
the table written in step 1.
3) I got rid of the "real" subforms.
This method works nicely because the user can click on any column and
still get the subform. On the other hand, on the first load the
subform pops up and trying to pop up multiple subforms doesn't quite
work as expected; ditto for scrolling on the datasheet. Both are
pretty minor irritations and I can live with them for now.