Solved

Access Form: Records

Posted on 2013-05-17
14
347 Views
Last Modified: 2013-05-21
I have an Access 2007 form that has 15000 records and when the form is opened it starts at record 1 how do i get it to open at a new record for input.
0
Comment
Question by:CMILLER
  • 6
  • 6
  • 2
14 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 39175778
Set the DataEntry Property of the form to: Yes
0
 

Author Comment

by:CMILLER
ID: 39175790
When I set that to yes, it opens with a new record 1 of 1. I would like for it to open either at the last form entered or at a new one after the last one entered.
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 39175792
However this would be better managed from a "Menu" form.
From this Menu form you would select the mode to open the form in

1. Edit
2. Read Only
3. New Record

Code on "Edit" button:
Docmd.OpenForm "YourFormName"

Code on the "Read Only" Button:
Docmd.OpenForm "YourFormName",,,,acFormReadOnly

Code on the "New Record" Button:
DoCmd.OpenForm "YourFormName", , , , acFormAdd


JeffCoachman
0
Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 39175812
<When I set that to yes, it opens with a new record 1 of 1. I would like for it to open either at the last form entered or at a new one after the last one entered. >
So you want to open the form with all the records available, but to be on a new record.

You need to do this with code;

On the Open Event of the form, put code like this:

DoCmd.GoToRecord , , acNewRec


JeffCoachman
0
 

Author Comment

by:CMILLER
ID: 39175861
Do I add that in the macro that opens the form?
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 39176011
No, you add that to the "Open" event of the form.

If you need this in a maco format it is:
Action:  GoToRecord
Arguments:  , , New,
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 39176031
Like so:
Database44.accdb
0
 

Author Comment

by:CMILLER
ID: 39176151
I wasnt able to open the DB.

Check out the attachments.
Form.JPG
0
 

Author Comment

by:CMILLER
ID: 39176153
0
 

Author Comment

by:CMILLER
ID: 39176155
Do I have it correct in the Form.jpg
0
 
LVL 29

Expert Comment

by:IrogSinta
ID: 39176391
That is not where you would put the DoCmd code.  Click on the ellipses {...} so that the code editor will open up and paste the code in there.
0
 
LVL 29

Accepted Solution

by:
IrogSinta earned 200 total points
ID: 39176392
It should look similar to this:
Private Sub Form_Load()
    DoCmd.GoToRecord , , acNewRec
End Sub
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 39176522
...or (as I stated) if you need this in a macro....
Click the ellipses [...] for the Open event of the form, and select "Macro builder"

Then build your macro similar to this:
Action:  GoToRecord
Arguments:  , , New,
0
 

Author Closing Comment

by:CMILLER
ID: 39184068
Thanks.
0

Featured Post

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article is a continuation or rather an extension from Cascading Combos (http://www.experts-exchange.com/A_5949.html) and builds on examples developed in detail there. It should be understandable alone, but I recommend reading the previous artic…
In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question