You should renumber the existing steps before going to the new record. Try
this:
Private Sub AddNewRecord_Click()
On Error GoTo Err_AddNewRecord_Click
Dim db As Database
Dim strSQL As String
Dim iCurrentStep as Integer
' turn off screen updating
Me.Painting = False
' save the step of the current record
iCurrentStep = Me.Step
' move all steps below and including the current one down a notch
strSQL = "UPDATE yourtable SET Step = Step + 1 " _
& "WHERE machineid = " & Me.MachineID _
& " AND Step >= " & iCurrentStep
Set db = CurrentDb()
db.Execute strSQL, dbFailOnError
' go to a new record and enter the step number
DoCmd.GoToRecord , , acNewRec
Me.Step = iCurrentStep
' requery the form to put the new step in the right place
Me.Requery
' position the record to the new step
With Me.RecordsetClone
.FindFirst "Step=" iCurrentStep
Me.Bookmark = .Bookmark
End With
Exit_AddNewRecord_Click:
Me.Painting = True
Exit Sub
Err_AddNewRecord_Click:
MsgBox Err.Description
Resume Exit_AddNewRecord_Click
End Sub
You might need to change some field names (Step and/or MachineID). Also, if
any other fields (say, StepDescription) are required, you will need to put
some dummy values into them before the Me.Requery.

Signature
Good Luck!
Graham Mandeno [Access MVP]
Auckland, New Zealand
When it says "yourtable" do I put my table name in there?
">You might need to change some field names (Step and/or MachineID). Also,
if
>any other fields (say, StepDescription) are required, you will need to put
>some dummy values into them before the Me.Requery."
I don't see any other fields that say "StepDescription" and
What type of dummy values do you mean?
>You should renumber the existing steps before going to the new record. Try
>this:
[quoted text clipped - 43 lines]
>>>>>Use the same code, except for SET Step = Step - 1
>>>>>in the delete button's Click event.
Graham Mandeno - 12 Nov 2005 01:46 GMT
> When it says "yourtable" do I put my table name in there?
Precisely!
> ">You might need to change some field names (Step and/or MachineID).
> Also,
[quoted text clipped - 4 lines]
> I don't see any other fields that say "StepDescription" and
> What type of dummy values do you mean?
I assume that MachineID and Step are "required" fields in your table. What
I meant is that if you have any *other* required fields, your code must put
values into them before the Me.Requery line, because requerying the form
forces a save.
As an example, say you have a required field named StepDescription. Your
code might read:
Me.Step = iCurrentStep
Me.StepDescription = "Enter the description here"
Me.Requery

Signature
Good Luck!
Graham Mandeno [Access MVP]
Auckland, New Zealand
>>You should renumber the existing steps before going to the new record.
>>Try
[quoted text clipped - 46 lines]
>>>>>>Use the same code, except for SET Step = Step - 1
>>>>>>in the delete button's Click event.