Open form with last record

jarhead58

Active Member
Joined
Sep 21, 2017
Messages
367
Office Version
  1. 2021
Platform
  1. Windows
Excel 2016

Hello all!!

When first opening the workbook, I have my form show! I want to have it populate with the last/newest record! Am I correct in assuming I would need to do something like this??

Code:
Private Sub Form_Load()
        If Not Me.NewRecord Then
            RunCommand acCmdRecordsGotoLast
        End If
End Sub

I tried this with no luck!
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
Is this an Access or Excel question?
 
Upvote 0
Excel doesn't have anything like RunCommand, it doesn't have 'records' and acCmdRecordsGoToLast is an Access VBA constant, so I'm a little confused.:eek:
 
Upvote 0
Thats why I wa asking for help! Got that from a friend who, I guess, thought it could be used in excel! Any help is greatly appreciated!
 
Upvote 0
What do you actually have if not an Access database?

Do you have data in Excel that you are viewing/editing etc via a userform?
 
Upvote 0
Yes, it's a data entry form to input information! There are about 2000 records. I just want the form to open with the newest record data in the proper text boxes for editing, deleting, etc. when it pops up.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,181
Members
453,022
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top