On 1 Mar 2005 12:16:07 -0800,
ma************@eaton.com wrote:
So I think this may be a stretch, but I have a subform that is
displayed on a main form. The subform is based on a query that brings
records from a table(It does not bring all fields, but the main
identifiers, since there would be too many to be able to display). The
user specifies criteria on the form, which narrows down the number of
records shown in the subform. Underneath the subform, there is another
subform that consists of 25 fields, but displayed in form view as
opposed to datasheet view(this way, only one record is shown at a time,
but I can display more data on the single form. Is there any way that
someone can simply highlight one of the many records from the first
subform, and the info for the fields specific to that record will then
be shown in the other subform??? This was hard to explain, so I hope
it makes sense.
Thanks,
Matt
Yes - it can be done, but you have to watch for contention issues between the
subforms if editing is allowed on both (or somethines even if it isn't).
The Current event fires on a form each time you move to a new record, and you
can use that to trigger a re-sync of the other subform. There are 2 gotchas
here, though.
1. Subforms are initialized before the parent forms, so your code can crash
the first time you try to process the Current event on the subform.
2. Sometimes, the Current event can fire before the recordset is opened, so
your Current event handler can crash trying to read data from the current
record the first time it fires.
I'll post back later when I have more time about strategies for working around
these gotchas.