L
laavista
I have a form with 12 fields bound to a table--the 3rd field is a required
field set at table level, and have a "delete" button on form.
Scenario: user fills in the 1st or 2nd field and leaves the 3rd, required,
field blank.
User clicks on "delete" button.
I use the following code when "delete" button is clicked:
===========================
If Me.Dirty = True Then Me.Dirty = False
If Me.NewRecord = -1 Then
MsgBox "New record--nothing to delete.", vbInformation, "No delete"
Exit Sub
End If
DeleteTheRecord 'call module & delete if they say yes
=====================================
If I don't "save" the record first using "If Me.Dirty = True Then Me.Dirty =
False", then newrecord is set to -1 and doesn't delete the record.
If I "save" the record using "If Me.Dirty = True Then Me.Dirty = False",
then it goes into my error handling routine because a required field is blank.
Any suggestions would be greatly appreciated.
(I'm using Access 2007)
field set at table level, and have a "delete" button on form.
Scenario: user fills in the 1st or 2nd field and leaves the 3rd, required,
field blank.
User clicks on "delete" button.
I use the following code when "delete" button is clicked:
===========================
If Me.Dirty = True Then Me.Dirty = False
If Me.NewRecord = -1 Then
MsgBox "New record--nothing to delete.", vbInformation, "No delete"
Exit Sub
End If
DeleteTheRecord 'call module & delete if they say yes
=====================================
If I don't "save" the record first using "If Me.Dirty = True Then Me.Dirty =
False", then newrecord is set to -1 and doesn't delete the record.
If I "save" the record using "If Me.Dirty = True Then Me.Dirty = False",
then it goes into my error handling routine because a required field is blank.
Any suggestions would be greatly appreciated.
(I'm using Access 2007)