J
John Keith
I was searching for the solution to keeping the selected record of a
continous form in the same place after a requery. I was pointed to Stephen
Lebans solution at http://www.lebans.com/setgetsb.htm
The initial set up worked great. However I have a complex app and i'm
having trouble getting the "other" parts to work now.
Application description:
Main-Form has a sub-form, sub-form has a cmdbutton that launches a
modal-popup search form to select a key that is set into the sub-form filter.
The main-form detail shows a list of all possible student-applications to
select. Students are grouped by a tracer-key which represents a household.
The sub-form shows a group of house-hold members for a tracer-key.
A button on the sub-form allows choosing a tracer-key by poping up a form
with searches to filter the data then select a household-tracer by clicking.
This returns back to the main & sub form and filters the sub-form records to
that house-hold-tracer.
I imported the class module: clsSetRow and the standard module:
modGet-SetScrollInfo. Then added the calling code to my main-form's module.
The main-form's detail click will add the clicked-on student-application to
the household by setting the tracer on that detail record. The form and
sub-form are requeried and the main-form detail is set back to the current
record just fine.
I have added the same calling-code that the main-form has to the sub-form
module. I replaced me.___ in all cases with me.parent.___ thinking that this
would keep the main-form's detail scrolled to the same record that it was on
originally after the fields were updated and the form requeried.
The issue is that the pop-up form when attempting to set the sub-form filter
is calling the sub-form's_Current module, that should work, but after it
completes the code and comes back to finish the popup modules routine the
DoCmd.Close does not close the pop-up and the routine just exits leaving the
popup having focus and the main/sub form is nowhere to be found.
I tried adding a DoEvents after the DoCmd.Close, but I get the same results.
Any thoughts on what I am doing wrong?
continous form in the same place after a requery. I was pointed to Stephen
Lebans solution at http://www.lebans.com/setgetsb.htm
The initial set up worked great. However I have a complex app and i'm
having trouble getting the "other" parts to work now.
Application description:
Main-Form has a sub-form, sub-form has a cmdbutton that launches a
modal-popup search form to select a key that is set into the sub-form filter.
The main-form detail shows a list of all possible student-applications to
select. Students are grouped by a tracer-key which represents a household.
The sub-form shows a group of house-hold members for a tracer-key.
A button on the sub-form allows choosing a tracer-key by poping up a form
with searches to filter the data then select a household-tracer by clicking.
This returns back to the main & sub form and filters the sub-form records to
that house-hold-tracer.
I imported the class module: clsSetRow and the standard module:
modGet-SetScrollInfo. Then added the calling code to my main-form's module.
The main-form's detail click will add the clicked-on student-application to
the household by setting the tracer on that detail record. The form and
sub-form are requeried and the main-form detail is set back to the current
record just fine.
I have added the same calling-code that the main-form has to the sub-form
module. I replaced me.___ in all cases with me.parent.___ thinking that this
would keep the main-form's detail scrolled to the same record that it was on
originally after the fields were updated and the form requeried.
The issue is that the pop-up form when attempting to set the sub-form filter
is calling the sub-form's_Current module, that should work, but after it
completes the code and comes back to finish the popup modules routine the
DoCmd.Close does not close the pop-up and the routine just exits leaving the
popup having focus and the main/sub form is nowhere to be found.
I tried adding a DoEvents after the DoCmd.Close, but I get the same results.
Any thoughts on what I am doing wrong?