Solved

Access Form: Records

Posted on 2013-05-17
14
343 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
 
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
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.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
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…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

911 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now