• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 113
  • Last Modified:

Don't start the next record

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
TIgerV
Asked:
TIgerV
  • 4
  • 3
  • 3
1 Solution
 
Guru JiCommented:
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
 
PatHartmanCommented:
Open the property sheet for the form.
On the "Other" tab, change the "Cycle" property to "Current Record".
0
 
TIgerVAuthor Commented:
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
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
Guru JiCommented:
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
 
Guru JiCommented:
Also are you using this on a Sub form ?
0
 
TIgerVAuthor Commented:
write2mohit: I am using the form and using it as a subform.
0
 
PatHartmanCommented:
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
 
TIgerVAuthor Commented:
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
 
TIgerVAuthor Commented:
See attachment for example.
new-entry.png
0
 
PatHartmanCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 4
  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now