How do I set focus back to my record on my subform after requery?

M

M Skabialka

I created a form with a subform showing multiple records in continuous form
view. By clicking or double clicking on one of these records the user is
taken to another form where lots of information is entered about the record.
When that form closes I requery the subform to update one field;
TotalRemoved. However the focus then moves away from the highlighted record
on the subform to the top one, when our users would like to continue
selecting items further down and have to scroll as many as 50 records down
to get back to where they were. I have separated the records into groups
and am using tabs to make the lists shorter.

The updated field is: forms!frmItemRemoved![frmItemRemoved
subform6].Form![TotalRemoved] and is updated each time the user clicks and
adds information on the other form. There are 10 tabs, so 10 instances of
the subform. The other fields that show on this subform do not change -
they just identify the item so the user can select it.

The Tab name is obtained from
forms!frmItemRemoved!MajorGroup.Pages(forms!frmItemRemoved!MajorGroup.Value).[Name]

How can I keep the focus on the selected record on the subform, or return to
it after the requery?
I think I need to use a GoToControl and a FindRecord but have been unable to
make it work using multiple subforms on tabs. Each record has an
ItemRemovedID.

Thanks,
Mich
 
M

M Skabialka

Worked great - thanks a lot!
Mich

Al Campagna said:
M,
Check out Stephen Lebans SetGetSB.Zip.
http://www.lebans.com/setgetsb.htm
The "SelTop" section of that file, is used to Restore a subform's row
position after a Requery.
I've used it, and it's works very well.
--
hth
Al Campagna
Microsoft Access MVP
Candia Computer Consulting
http://home.comcast.net/~cccsolutions/index.html

M Skabialka said:
I created a form with a subform showing multiple records in continuous
form view. By clicking or double clicking on one of these records the
user is taken to another form where lots of information is entered about
the record. When that form closes I requery the subform to update one
field; TotalRemoved. However the focus then moves away from the
highlighted record on the subform to the top one, when our users would
like to continue selecting items further down and have to scroll as many
as 50 records down to get back to where they were. I have separated the
records into groups and am using tabs to make the lists shorter.

The updated field is: forms!frmItemRemoved![frmItemRemoved
subform6].Form![TotalRemoved] and is updated each time the user clicks
and adds information on the other form. There are 10 tabs, so 10
instances of the subform. The other fields that show on this subform do
not change - they just identify the item so the user can select it.

The Tab name is obtained from
forms!frmItemRemoved!MajorGroup.Pages(forms!frmItemRemoved!MajorGroup.Value).[Name]

How can I keep the focus on the selected record on the subform, or return
to it after the requery?
I think I need to use a GoToControl and a FindRecord but have been unable
to make it work using multiple subforms on tabs. Each record has an
ItemRemovedID.

Thanks,
Mich
 
A

Al Campagna

M,
It would be good to drop Stephen Leban's a little thank you note too.
He's done a great deal of work on his site, and I'm sure he'd appreciate
some positive feedback.

--
hth
Al Campagna
Microsoft Access MVP
Candia Computer Consulting

http://home.comcast.net/~cccsolutions/index.html
M Skabialka said:
Worked great - thanks a lot!
Mich

Al Campagna said:
M,
Check out Stephen Lebans SetGetSB.Zip.
http://www.lebans.com/setgetsb.htm
The "SelTop" section of that file, is used to Restore a subform's row
position after a Requery.
I've used it, and it's works very well.
--
hth
Al Campagna
Microsoft Access MVP
Candia Computer Consulting
http://home.comcast.net/~cccsolutions/index.html

M Skabialka said:
I created a form with a subform showing multiple records in continuous
form view. By clicking or double clicking on one of these records the
user is taken to another form where lots of information is entered about
the record. When that form closes I requery the subform to update one
field; TotalRemoved. However the focus then moves away from the
highlighted record on the subform to the top one, when our users would
like to continue selecting items further down and have to scroll as many
as 50 records down to get back to where they were. I have separated the
records into groups and am using tabs to make the lists shorter.

The updated field is: forms!frmItemRemoved![frmItemRemoved
subform6].Form![TotalRemoved] and is updated each time the user clicks
and adds information on the other form. There are 10 tabs, so 10
instances of the subform. The other fields that show on this subform do
not change - they just identify the item so the user can select it.

The Tab name is obtained from
forms!frmItemRemoved!MajorGroup.Pages(forms!frmItemRemoved!MajorGroup.Value).[Name]

How can I keep the focus on the selected record on the subform, or
return to it after the requery?
I think I need to use a GoToControl and a FindRecord but have been
unable to make it work using multiple subforms on tabs. Each record has
an ItemRemovedID.

Thanks,
Mich
 

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