I have a single form, that allows additions, deletions, edits, <etc.> F
rom it, I can delete any record at any given time...
It's not a problem with any of the other records... just the last one; and the real problem is I have no idea where to look (or what to look for);
it's one of those things that wasn't before, and sometime between "now" and "then" it must have started...
the new problem:
When I delete the last record, it creates / goes to a new record, rather than navigating to the next to last record (previous record).
The new record is null; and because (?) one of the fields is required, I first get a warning that says: "can't go to the specified record", and then the null record is displayed.
The user is forced to enter a "junk" value (in the required field) in order to navigate away from the record (... and then to delete that bogus record, they have to have entered a value that would have put the record somewhere (not last), navigate to it, then delete it).
(this is not good)
this is the code I use to delete records:
Code:
Private Sub cmdDelType_Click()
On Error GoTo Err_cmdDelType_Click
'delete the record and move to the previuos record
DoCmd.SetWarnings True
strPrompt = "Confirm that you want to delete this fixture type..."
strTitle = "DELETE FIXTURE TYPE"
Response = MsgBox(strPrompt, vbYesNo + vbExclamation, strTitle)
If Response = vbYes Then
If Me.NewRecord Then
DoCmd.GoToRecord , , acPrevious
Else
DoCmd.DoMenuItem acFormBar, acEditMenu, 8, , acMenuVer70
DoCmd.DoMenuItem acFormBar, acEditMenu, 6, , acMenuVer70
If Me.NewRecord Then
DoCmd.GoToRecord , , acPrevious
End If
End If
End If
Exit_cmdDelType_Click:
Exit Sub
Err_cmdDelType_Click:
MsgBox Err.Description
Resume Exit_cmdDelType_Click
End Sub
any suggestions will be greatly appreciated in advance,
Mark