Is there any way to stop Access from returning to the first record when a command button turning on the edit mode is clicked? For example, if a user is browsing the database via the form and comes upon a record that needs to be updated and clicks on the turn on edit mode button she invariably is returned to the first record in the database. I want it to remain on the record needing to be updated. See code below:
'Turn on or off AllowEdits, AllowAdditions and AllowDeletions.
'Change button's caption
If Me.AllowAdditions = True Then
With Me
.AllowAdditions = False
.AllowDeletions = False
.AllowEdits = False
End With
Me.cmdEditMode.Caption = "Edit Mode Off"
Else
With Me
.AllowAdditions = True
.AllowDeletions = True
.AllowEdits = True
End With
Me.cmdEditMode.Caption = "Edit Mode On"
End If
Me.Requery 'reloads the data on the form to the current setting
'Turn on or off AllowEdits, AllowAdditions and AllowDeletions.
'Change button's caption
If Me.AllowAdditions = True Then
With Me
.AllowAdditions = False
.AllowDeletions = False
.AllowEdits = False
End With
Me.cmdEditMode.Caption = "Edit Mode Off"
Else
With Me
.AllowAdditions = True
.AllowDeletions = True
.AllowEdits = True
End With
Me.cmdEditMode.Caption = "Edit Mode On"
End If
Me.Requery 'reloads the data on the form to the current setting