Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Continuous Form Focus

Status
Not open for further replies.

Henc

Technical User
Oct 11, 2001
6
US
How do you set the focus to the top entry in a continuous subform? If I edit values in the subform anywhere below the first line, and then recalc the values and requery the subform, I end up at the line that I left off with, but I want to end up back at the very top. Is there a way to do this?

Thanks
 
Hi Henc,

Could you please specify the controls which you have then tell me more clear from where to where you want to jump.

Best Regards
 
Thanks fo the response,

I have a form that has a recalc button which recalcs a subform based on a combo box on the main form. The subform looks similar to a datasheet, but I used text boxes so that I can lock some values and have others be updatable. I select a value in the main form's combo box which returns values in the subform, say it has five rows. I alter some of the values in the third row of the subform and click the recalc button which runs through some code to update a few tables and requeries the subform. All values are calculated correctly, but I only see the last three rows of the subform even though there is plenty of room to display all five rows. I can see the top two rows if I use the scroll bar, but I want it to default to show all rows starting with the top most row. Any clue as to how to do this?

Thanks,
Henc
 
First off, we need to not visualize a set of data as having a "top" or "bottom". I think what you need to do is refresh the display so that all five records are visible, if you have ROOM for them. You might want to re-do a sort, which would be needed if your data change caused a record to 'change position' in the logical order. For example, if you have five records, and they're sorted in DATE order, and you change the DATE of "record #3", after you do your recalc, it may not be "record #3" anymore. Maybe now it's "record 5" in your sequence. I think Access is trying to keep the current record visible at the top of the control, thus making records 1,2,3 and 4 get pushed up.

"Remember, you're unique - just like everyone else"
You're invited to visit another free Access forum:
or my site,
 
I have sorted it by one field, so when I speak of the "top" record, I meant the first one. I think it has something to do with bookmarks. Do I need to somehow reset the bookmark to the first record? If so, how do I accomplish that?

Henc
 
You can design a macro that will go to a particular record, and you can "offset" it either backward or forward. My problem was, the "offset" doesn't work if you choose to go to the first or the last record. I have a form that I've "macroed" to go to the last record. It displays the last record at the "top" of the subform. As soon as I touch the vertical scroll bar the last record jumps to the bottom of the form, with the twenty previous records displayed in order above it. Spooky, can't get around it, so I'm tagging this thread in hopes that someone can fix it...

Cheers. Gus Brunston :cool: An old PICKer, using Access2000. I manage Suggestions welcome. padregus@attbi.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top