Open form with last record

jarhead58

Active Member
Joined
Sep 21, 2017
Messages
348
Office Version
  1. 2016
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

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
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,214,376
Messages
6,119,174
Members
448,870
Latest member
max_pedreira

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