open form and show most recent record (1 Viewer)

kobiashi

Registered User.
Local time
Today, 22:45
Joined
May 11, 2018
Messages
258
hi

this is probably the most easiest thing to do, but i cannot find and answer


i would like to open a form with the most recent record from button click

ive found how to load the most recent record, but that requires the form to already be open
 

Gasman

Enthusiastic Amateur
Local time
Today, 22:45
Joined
Sep 21, 2011
Messages
14,238
I use this in the load event of one of my forms
Code:
    DoCmd.RunCommand acCmdRecordsGoToLast
 

kobiashi

Registered User.
Local time
Today, 22:45
Joined
May 11, 2018
Messages
258
I use this in the load event of one of my forms
Code:
    DoCmd.RunCommand acCmdRecordsGoToLast


thank you, didnt occur to me to execute it on the form, was trying to do it from the button.
 

missinglinq

AWF VIP
Local time
Today, 17:45
Joined
Jun 20, 2003
Messages
6,423
Code:
    [B]DoCmd.RunCommand acCmdRecordsGoToLast[/B]

Wouldn't that be problematic if the Form is Sorted and the last Record entered was not necessarily the last Record when the Form opens?

Linq ;0)>
 

kobiashi

Registered User.
Local time
Today, 22:45
Joined
May 11, 2018
Messages
258
Wouldn't that be problematic if the Form is Sorted and the last Record entered was not necessarily the last Record when the Form opens?

Linq ;0)>
I run and append query to create a new entry from a button, that also opens the form.

Sent from my ONEPLUS A6003 using Tapatalk
 

Gasman

Enthusiastic Amateur
Local time
Today, 22:45
Joined
Sep 21, 2011
Messages
14,238
Well not for me, as I just want to see the last 5 records and then generally add a new record.
As it also has a Emulated Split Form as a subform, the source is set on form open.

Wouldn't that be problematic if the Form is Sorted and the last Record entered was not necessarily the last Record when the Form opens?

Linq ;0)>
 

Users who are viewing this thread

Top Bottom