473,324 Members | 2,248 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

focussing last entry of a datasheet or listbox

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
1 2025
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Sami | last post by:
I am creating a student database. We would like to be able to look up students by ID number. New students will be input to the tables / records daily, but looking up student by ID number will be...
11
by: David Messner | last post by:
Ok I know this is simple but the statement eludes me... I have a date field where I want the default value on the data entry form's date field to be the last date entered. I figure I can do this...
6
by: Sami | last post by:
Problem: Social Security number being used in a database. First problem is that it will not permit numbers beginning in zero to be entered - it sees it as a null or empty space from what I can...
1
by: Yuki | last post by:
I am trying to find out if I can have a specific record that has been selected in a list box be opened in datasheet view. I can't seem to find where this can happen or what I need to use to make...
4
by: Bob | last post by:
I'm running Access 97 and have a sub-form within a main form. The subform allows data entry by the user. Now, I would also like to enter a row from a macro, but when I try, the entry always goes...
1
by: jez123456 | last post by:
Hi, I have a windows form with a listbox control. My code all works correctly when deleting an item from the listbox except the last item. I get the following message when trying to delete the...
5
by: John Veldthuis | last post by:
My code works perfectly 100% when adding items to my ArrayList and updating the listbox. Works perfectly when deleting an item in the ArrayList when it is not the last entry but if it is the last...
5
by: Wernerh | last post by:
Hi, I have created a log in a listbox to show users everytime someone has logged on. Is there a form load function that will scroll down the listbox to the last entry each time the form is loaded?? ...
7
by: CCHDGeek | last post by:
I have a subform that is searched according to a field value on the main form. The subform has mutiple pages and each page has a subform based off a query. Today when I logged into the main form,...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.