Another way is to set the form's Data Entry property to True. Access will then open the form ready to add a record. The user can still use it for browsing and editing existing records (if Allow Edits is Yes) by removing filtering with the menu or toolbar button, and can return to Data Entry mode by choosing Records>Data Entry from the menu. Rick Sprague
I want to do this same thing (Open a form and go to the last record) except mine is in a sub form. When I put the DoCmd.GoToRecord , , acLast in my subform and open it... it does exactly what I want. When I open my main form though, I get an error saying that the subform isn't open yet.
Where do I need to place this code so that my subform goes automatically to the last record?
Do you have a Macro that opens your main form? If so you need to add another action.
Open the macro in design view. Add A GoTo Rrecord action below the OpenForm action.
The action arguments will be as follows:
Object Type: Form
Object Name: the name of your main form
Record: chose last or new if you want it to open to a new blank record.
If what you are doing is designed to display the last (and presumably the LATEST record in the subform) why not change the sort order for the subform to Descending?
This will automatically bring the latest records to the top of the form whenever the form/subform is opened. As new records are added to the subform, they will also be automatically sorted to the top the next time the form is opened.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.