Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 40
  1. #16
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Quote Originally Posted by mike60smart View Post
    Yes you are right, stupid of me to use Delete
    Well, VBA had not exactly been your forte?
    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

  2. #17
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,566
    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

  3. #18
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Quote Originally Posted by mike60smart View Post
    At least I got the Before Update element right
    Bob mentioned that event prior to your post?
    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

  4. #19
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,566
    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

  5. #20
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Quote Originally Posted by mike60smart View Post
    I put it down to Bob types quicker
    Yes, he is pretty slick.
    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

  6. #21
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    Quote Originally Posted by mike60smart View Post
    What Code did you use?
    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.

  7. #22
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,566
    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

  8. #23
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2019
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Quote Originally Posted by mike60smart View Post
    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 could set the form's AllowAdditions property to false but you would have find a way enter a new record when it is required.
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  9. #24
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,940
    Quote Originally Posted by deepaksharma View Post
    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
    How many times do you need to be told???
    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

  10. #25
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    Quote Originally Posted by Welshgasman View Post
    How many times do you need to be told???
    There is nothing to delete!!!
    Sir, I do not want to delete the record, but I want to delete the empty rows, see in the picture.
    Attached Thumbnails Attached Thumbnails 2blanckUntitled.png   1blankUntitled.png  

  11. #26
    Join Date
    May 2018
    Location
    Living in Scotland UK
    Posts
    1,566
    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

  12. #27
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2019
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,544
    Quote Originally Posted by deepaksharma View Post
    Sir, I do not want to delete the record, but I want to delete the empty rows, see in the picture.
    Run a DELETE query:
    Code:
    DELETE GREY_SHADE.Shade, GREY_SHADE.MeterFROM GREY_SHADE
    WHERE (((GREY_SHADE.Shade) Is Null) AND ((GREY_SHADE.Meter) Is Null));
    EDIT
    If you had set up validation correctly in the first place you would not have any blank rows.
    I agree
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  13. #28
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    Quote Originally Posted by Bob Fitz View Post
    If you had set up validation correctly in the first place you would not have any blank rows.
    Please tell where and how to set

  14. #29
    moke123's Avatar
    moke123 is offline Me.Dirty=True
    Windows 11 Office 365
    Join Date
    Oct 2012
    Location
    Ma.
    Posts
    1,654
    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

  15. #30
    deepaksharma is offline Competent Performer
    Windows 7 32bit Access 2016
    Join Date
    Jul 2023
    Location
    india
    Posts
    389
    Quote Originally Posted by moke123 View Post
    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.
    You are absolutely right and such this type Mistake user can also be made during new entry.

Page 2 of 3 FirstFirst 123 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Auto Text Insert In To A Blank Field In A Form
    By HectorTheInspector in forum Forms
    Replies: 8
    Last Post: 01-20-2017, 06:52 PM
  2. Replies: 4
    Last Post: 01-04-2016, 07:30 AM
  3. Replies: 2
    Last Post: 03-19-2014, 04:51 PM
  4. Code to delete the blank rows
    By drunkenneo in forum Programming
    Replies: 3
    Last Post: 02-17-2014, 09:26 PM
  5. delete record if 2 fields are blank
    By rlsublime in forum Access
    Replies: 1
    Last Post: 06-20-2012, 01:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums