Cancel delete strange behaviour

M

Max

Hi,

I have a nested form in Access 97 with a cancel delete option.
The problem I have is the records scroll up with the delete. If the delete
is cancelled then the records are not displayed and the user thinks the
record has been cancelled. I have tried moving the focus to the first record
but this code does not work except when the first record in the subform is
being deleted.

Any suggestions?
Thanks in advance

Max

The code as follows:

Private Sub Form_BeforeDelConfirm(Cancel As Integer, Response As Integer)
Cont CANCELDELETE = 2
Dim Answer

Response = acDataErrContinue ' Suppress default delete confirm
dialog box.
Answer = MsgBox("Are you sure you want to delete this record?", 1,
"Delete Warning")
If Answer = CANCELDELETE Then
Cancel = True
Forms![PGIQuick]![PGIQuickSub].Form![PGIProcedureSub].SetFocus
DoCmd.GoToRecord , , acFirst
End If

End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top