J
JC
If I load a form whose resource is an empty table, I get a
blank record that I can enter data into.
If my table has only one record in it and I delete it, I
get error 3021.
I am using docmd.runcommand accmddeleterecord to delete
the records on the form.
What do I have to do in order to delete that one and only
record without an error?
Once I do that, then I can code it to go into "add mode".
My code is below.
Private Sub butIDel_Click()
Dim Response As Integer
Response = MsgBox("Are you sure you want to delete this
record?" & vbCrLf & "You will NOT be able to get this data
back!", vbYesNo, "Warning!")
If Response = vbYes Then
DoCmd.SetWarnings False
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand (acCmdDeleteRecord)
DoCmd.GoToRecord , , acLast
DoCmd.SetWarnings True
End If
Me.PartNum.SetFocus
End Sub
blank record that I can enter data into.
If my table has only one record in it and I delete it, I
get error 3021.
I am using docmd.runcommand accmddeleterecord to delete
the records on the form.
What do I have to do in order to delete that one and only
record without an error?
Once I do that, then I can code it to go into "add mode".
My code is below.
Private Sub butIDel_Click()
Dim Response As Integer
Response = MsgBox("Are you sure you want to delete this
record?" & vbCrLf & "You will NOT be able to get this data
back!", vbYesNo, "Warning!")
If Response = vbYes Then
DoCmd.SetWarnings False
DoCmd.RunCommand acCmdSelectRecord
DoCmd.RunCommand (acCmdDeleteRecord)
DoCmd.GoToRecord , , acLast
DoCmd.SetWarnings True
End If
Me.PartNum.SetFocus
End Sub