E
Ella
My main form, frmReview, contains a sub form, frmReviewSub, that displays in
a spreadsheet format from a union query.
To delete a record the user selects a record in the sub-form and then
presses a button to open a pop-up form to gives the user the option to press
a cancel button to take no action or to continue by pressing a delete button.
When the delete button is pressed the pop-up form closes, runs the delete
query and requerys the sub form in my main form, code below.
The problem is that the requery is frustrating the users by returning the
sub form back to the first record, which means they need to scroll back
through the records to find where they were at before the delete.
Is there a way to prevent this from happening and or to select the next
record after the deleted record?
I hope someone can help!
Regards
Ella
Private Sub cmdDeleteActionItem_Click()
On Error GoTo Err_cmdDeleteActionItem_Click
'frmDeleteItem
Dim stDocName As String
DoCmd.Close
stDocName = "QfrmDeleteItem"
DoCmd.OpenQuery stDocName, acNormal, acEdit
[Forms]![frmReview]![frmReviewSub].Requery
Exit_cmdDeleteActionItem_Click:
Exit Sub
Err_cmdDeleteActionItem_Click:
MsgBox Err.Description
Resume Exit_cmdDeleteActionItem_Click
End Sub
a spreadsheet format from a union query.
To delete a record the user selects a record in the sub-form and then
presses a button to open a pop-up form to gives the user the option to press
a cancel button to take no action or to continue by pressing a delete button.
When the delete button is pressed the pop-up form closes, runs the delete
query and requerys the sub form in my main form, code below.
The problem is that the requery is frustrating the users by returning the
sub form back to the first record, which means they need to scroll back
through the records to find where they were at before the delete.
Is there a way to prevent this from happening and or to select the next
record after the deleted record?
I hope someone can help!
Regards
Ella
Private Sub cmdDeleteActionItem_Click()
On Error GoTo Err_cmdDeleteActionItem_Click
'frmDeleteItem
Dim stDocName As String
DoCmd.Close
stDocName = "QfrmDeleteItem"
DoCmd.OpenQuery stDocName, acNormal, acEdit
[Forms]![frmReview]![frmReviewSub].Requery
Exit_cmdDeleteActionItem_Click:
Exit Sub
Err_cmdDeleteActionItem_Click:
MsgBox Err.Description
Resume Exit_cmdDeleteActionItem_Click
End Sub