By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,662 Members | 1,779 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,662 IT Pros & Developers. It's quick & easy.

focussing last entry of a datasheet or listbox

P: n/a
hi folks,
I have embedded a datasheet as a subform and I want that
every time the datasheet is updated, the focus be set on
the last record and be visible for the user. that is like
simulating the users activation of the scrollbar, so that
the last record is visible.
got any idea?

thanx for your help, Helmut

Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Helmut Blass wrote:
hi folks,
I have embedded a datasheet as a subform and I want that
every time the datasheet is updated, the focus be set on
the last record and be visible for the user. that is like
simulating the users activation of the scrollbar, so that
the last record is visible.
got any idea?

thanx for your help, Helmut


When you change records in the MainForm, the records in the subform will
change to matching records in the subform.

I'm not sure when the subform records would be updated. Perhaps when
the OnCurrent event of the main form is executed. If so, you could find
the record then. MF = Mainfrom SF = Subform. Modify this to your needs
and insert in the Oncurrent of the MF. ID = the link field between MF
and SF

Dim rst As REcordset
Set rst = Forms!MF!SF.Form.Recordsetclone
rst.FindLast "ID = " & Me.ID
If not rst.NoMatch then
'we found the last record in the subform
Forms!MF!SF.Form.Bookmark = rst.BookMark
ENdif
rst.close
set rst = Nothing

You can look up some of the properties and methods in help for more
information.
Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.