Cancel Row Insert

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Paul

    Cancel Row Insert

    How can you cancel a row insert programmaticall y? I'm not talking
    about the Form_BeforeInse rt(Cancel As Integer). I have a continuous
    form. A new row is started. Code for the continuous form captures a
    KeyDown event (Ctrl+D) to delete the row. I can tell if the row is
    new. I just don't know how to cancel the new row.
  • Allen Browne

    #2
    Re: Cancel Row Insert

    Test the NewRecord property of the form to see if it is the new row.

    Test the form's Dirty property to see if a new entry has begun yet.

    --
    Allen Browne - Microsoft MVP. Perth, Western Australia
    Tips for Access users - http://allenbrowne.com/tips.html
    Reply to group, rather than allenbrowne at mvps dot org.

    "Paul" <pwh777@gmail.c omwrote in message
    news:94bb63b1-0a09-4815-b5ac-220403c24a50@q7 0g2000hsb.googl egroups.com...
    How can you cancel a row insert programmaticall y? I'm not talking
    about the Form_BeforeInse rt(Cancel As Integer). I have a continuous
    form. A new row is started. Code for the continuous form captures a
    KeyDown event (Ctrl+D) to delete the row. I can tell if the row is
    new. I just don't know how to cancel the new row.

    Comment

    • Salad

      #3
      Re: Cancel Row Insert

      Paul wrote:
      How can you cancel a row insert programmaticall y? I'm not talking
      about the Form_BeforeInse rt(Cancel As Integer). I have a continuous
      form. A new row is started. Code for the continuous form captures a
      KeyDown event (Ctrl+D) to delete the row. I can tell if the row is
      new. I just don't know how to cancel the new row.
      In someone pressed the Delete button you could, as Allen mentioned, test
      for the newrecord property in the OnDelete event.
      If Me.NewRecord then Cancel = True

      There is the Undo command. You can enter
      Me.Undo
      to remove reference to the new record in some event.

      Destination Unknown



      Comment

      Working...