Open form with last record

jarhead58

Active Member
Joined
Sep 21, 2017
Messages
329
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!
 

Some videos you may like

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,218
Office Version
  1. 365
Platform
  1. Windows
Is this an Access or Excel question?
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,218
Office Version
  1. 365
Platform
  1. Windows
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:
 

jarhead58

Active Member
Joined
Sep 21, 2017
Messages
329

ADVERTISEMENT

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!
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,218
Office Version
  1. 365
Platform
  1. Windows
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?
 

jarhead58

Active Member
Joined
Sep 21, 2017
Messages
329
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,122,841
Messages
5,598,388
Members
414,234
Latest member
grlevesq

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
Top