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.