Open Form ready for new record

spectraflame

Well-known Member
Joined
Dec 18, 2002
Messages
830
Office Version
  1. 365
Platform
  1. Windows
I have a button that when pressed opens a specific form. Each time I press the button, it opens the correct form, but it opens to the first record of the table.

Is there a way to have it open to the next available record so that I do not have to scroll through the records that are already in the database?

Thanks,
Matthew
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Would this code be placed in VB?

Still trying to learn Access. Sorry.

This is the code that is assigned to the button that I have opening the form.

stDocName = "Electric Form"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Would your suggestion be added somewhere in here?

Matthew
 
Upvote 0
DoCmd.OpenForm stDocName, , , stLinkCriteria, acFormAdd
will open the form for data entry but existing records will not be available to view. If you need the records available to look at, but want the form to open on a blank record, then you will need to add docmd.goto acNewRec to the open event of the form that you are opening.

HTH

Peter
 
Upvote 0
Thanks to all - that was exactly what I was looking for.

Thanks again,
Matthew
 
Upvote 0

Forum statistics

Threads
1,221,811
Messages
6,162,109
Members
451,743
Latest member
matt3388

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