?
Solved

Don't start the next record

Posted on 2014-10-02
10
Medium Priority
?
100 Views
Last Modified: 2015-04-19
On a form (frm_Log entries), I don't want to automatically start the next record.  I only want the next record to start when I click the "Add new record" button.
0
Comment
Question by:TIgerV
[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
  • 4
  • 3
  • 3
10 Comments
 
LVL 11

Expert Comment

by:Guru Ji
ID: 40357184
Hi, you can try something like this in your form

Private Sub Form_Load()
DoCmd.GoToRecord , , acLast
End Sub

Open in new window


This will show you the last record in your form and will only do the next record when you click add new.

Hope that helps.
0
 
LVL 38

Expert Comment

by:PatHartman
ID: 40357194
Open the property sheet for the form.
On the "Other" tab, change the "Cycle" property to "Current Record".
0
 

Author Comment

by:TIgerV
ID: 40357211
I have the docmd, but when I begin to enter a record, the 'next' record still shows up.
Same with changing the cycle property.  :-(
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 11

Expert Comment

by:Guru Ji
ID: 40357217
Make sure the DoCmd.GoToRecord , , acLast is the last row in your form load, because something in your form load is triggering the next record.
0
 
LVL 11

Expert Comment

by:Guru Ji
ID: 40357226
Also are you using this on a Sub form ?
0
 

Author Comment

by:TIgerV
ID: 40357235
write2mohit: I am using the form and using it as a subform.
0
 
LVL 38

Expert Comment

by:PatHartman
ID: 40357342
Please reread my suggestion.

In a form, when you tab out of the "last" control, the Cycle property tells Access what to do - go to a "new" record or stay on the current record.
0
 

Author Comment

by:TIgerV
ID: 40357433
The problem I have is when I go to a record and begin typing in the text field, Access pops up a new record, under where I'm currently entering information.

Since I have a default of "now()" in the time field, that new record has an invalid time by the time I populate it.

Cycle Property does not prevent that.
0
 

Author Comment

by:TIgerV
ID: 40357443
See attachment for example.
new-entry.png
0
 
LVL 38

Accepted Solution

by:
PatHartman earned 2000 total points
ID: 40358006
Wow, I never noticed that.  The reason I never noticed it is because I work mostly with SQL Server tables and so the defaults don't get populated until Access actually sends the update to the server.

If this is a problem for you, you can't use table level defaults.  You're going to have to populate them in the form.  In the BeforeUpdate event of all my forms I have two lines of code.
    Me.ChangeDT = Now()
    Me.ChangeBy = Forms!frmLogin!txtEmpID

Open in new window

to populate the change date and change by fields.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Preparing an email is something we should all take special care with – especially when the email is for somebody you may not know very well. The pressures of everyday working life stacked with a hectic office environment can make this a real challen…
Access custom database properties are useful for storing miscellaneous bits of information in a format that persists through database closing and reopening.  This article shows how to create and use them.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

777 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