Ally
Registered User.
- Local time
- Today, 05:29
- Joined
- Sep 18, 2001
- Messages
- 617
I have code on a command button to delete a record, generated by the wizard with a bit added to requery the next form that opens. But, when I use it, it then generates a new blank record which I don't want. It was okay at first, but I appear to have done something in the last couple of days that's changed it, but I'm not sure what.
This is the code:
Does anyone know why this is doing this and how to get over it please?
This is the code:
Code:
Dim UserResponse As Integer
DoCmd.SetWarnings False
UserResponse = msgbox("Are you sure you wish to delete
the current record?", vbYesNo, "Delete?")
If UserResponse = vbYes Then
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
DoCmd.Close
DoCmd.SelectObject acForm, "frmPatient"
DoCmd.Restore
Forms![frmPatient].Requery
End If
Does anyone know why this is doing this and how to get over it please?