Please use # icon on toolbar when posting code snippets.
Cross Posting: https://www.excelguru.ca/content.php?184
Debugging Access: https://www.youtube.com/results?sear...bug+access+vba
At least I got the Before Update element right
You can PM me if you need further help.
Good Reading https://docs.microsoft.com/en-gb/off...on-description
Please use # icon on toolbar when posting code snippets.
Cross Posting: https://www.excelguru.ca/content.php?184
Debugging Access: https://www.youtube.com/results?sear...bug+access+vba
I put it down to Bob types quicker
You can PM me if you need further help.
Good Reading https://docs.microsoft.com/en-gb/off...on-description
Please use # icon on toolbar when posting code snippets.
Cross Posting: https://www.excelguru.ca/content.php?184
Debugging Access: https://www.youtube.com/results?sear...bug+access+vba
Private Sub Form_BeforeUpdate(CANCEL As Integer)
If Me.SHADE.Value = "" and Me.meter.Value = "" Then
DoCmd.RunCommand acCmdDeleteRecord
End If
If Me.SHADE.Value = Null and Me.meter.Value = Null Then
DoCmd.RunCommand acCmdDeleteRecord
End If
If (IsNull(Me![SHADE].Value)) And (IsNull(Me![METER].Value)) Then
DoCmd.RunCommand acCmdDeleteRecord
End If
End Sub
This is not deleting empty row
Last edited by deepaksharma; 12-03-2023 at 05:35 AM.
If a Row (Record) is empty then there is nothing to delete.
There will always be a blank row in a Continuous Form which you cannot remove.
You can PM me if you need further help.
Good Reading https://docs.microsoft.com/en-gb/off...on-description
If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
Bob Fitzpatrick
How many times do you need to be told???Private Sub Form_BeforeUpdate(CANCEL As Integer)
If Me.SHADE.Value = "" and Me.meter.Value = "" Then
DoCmd.RunCommand acCmdDeleteRecord
End If
If Me.SHADE.Value = Null and Me.meter.Value = Null Then
DoCmd.RunCommand acCmdDeleteRecord
End If
If (IsNull(Me![SHADE].Value)) And (IsNull(Me![METER].Value)) Then
DoCmd.RunCommand acCmdDeleteRecord
End If
End Sub
This is not deleting empty row
There is nothing to delete!!!
Please use # icon on toolbar when posting code snippets.
Cross Posting: https://www.excelguru.ca/content.php?184
Debugging Access: https://www.youtube.com/results?sear...bug+access+vba
If you had set up validation correctly in the first place you would not have any blank rows.
You can PM me if you need further help.
Good Reading https://docs.microsoft.com/en-gb/off...on-description
Run a DELETE query:
EDITCode:DELETE GREY_SHADE.Shade, GREY_SHADE.MeterFROM GREY_SHADE WHERE (((GREY_SHADE.Shade) Is Null) AND ((GREY_SHADE.Meter) Is Null));
I agreeIf you had set up validation correctly in the first place you would not have any blank rows.
If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
Bob Fitzpatrick
I see his question differently.
He's not talking about new entries. He saying that users are going back to previous records and deleting portions of the record.
This is leaving previously entered records incomplete. Look at the screenshot.
If this helped, please click the star * at the bottom left and add to my reputation- Thanks
You are absolutely right and such this type Mistake user can also be made during new entry.