Solved

Access Form: Records

Posted on 2013-05-17
14
350 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

 
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

751 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