Results 1 to 6 of 6
  1. #1
    walterio is offline Advanced Beginner
    Windows 10 Access 2010 64bit
    Join Date
    Jul 2019
    Posts
    33

    Event beforeUpdate following event afterInsert not wanted

    Hi

    After inserting a record via (copy/)paste, the event AfterInsert should be triggered (which I use it to fill a Log-table). And this event only takes place if the focus is set on another record. And this triggers the event BeforeUpdate, which I don't want to be run at this moment. The insert process should stop for good after the AfterInsert event.

    Is there any command which would "glue" the record to the table, without having to leave the record?

    Thanks for your help


    Walter

  2. #2
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,530
    Have you tried:
    If Me.Dirty Then
    Me.Dirty = False
    End If
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  3. #3
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    i stopped using Before insert. Never found a use, they were just a headache.

  4. #4
    walterio is offline Advanced Beginner
    Windows 10 Access 2010 64bit
    Join Date
    Jul 2019
    Posts
    33
    Where should this piece of code be placed? At the After Insert event?

  5. #5
    Bob Fitz's Avatar
    Bob Fitz is offline Access Developer
    Windows 10 Access 2016
    Join Date
    May 2011
    Location
    Essex UK
    Posts
    3,530
    Quote Originally Posted by walterio View Post
    Where should this piece of code be placed? At the After Insert event?
    In the form's Before Update event
    If this helped, please click the star at the bottom left of this posting and add to my reputation . Many thanks.
    Bob Fitzpatrick

  6. #6
    walterio is offline Advanced Beginner
    Windows 10 Access 2010 64bit
    Join Date
    Jul 2019
    Posts
    33
    Quote Originally Posted by Bob Fitz View Post
    In the form's Before Update event
    (Sorry. I was replying with the quick reply and didn't see your reply.)

    And yes, Me.Dirty is true after the insert, but its also true after a normal change of a field value. So setting me.dirty to false doesn't help.

    But my approach with a pubic boolean isInsert did solve the problem!

    Thank you anyway

Please reply to this thread with any new information or opinions.

Similar Threads

  1. BeforeUpdate Event to Create New Copy of Current Record
    By breakingme10 in forum Programming
    Replies: 6
    Last Post: 06-29-2018, 10:15 AM
  2. Replies: 4
    Last Post: 05-04-2017, 01:16 AM
  3. Using Me.Dirty in a BeforeUpdate event procedure.
    By MatthewGrace in forum Programming
    Replies: 3
    Last Post: 11-30-2014, 12:40 PM
  4. Subform Events Has No BeforeUpdate Event
    By CementCarver in forum Programming
    Replies: 1
    Last Post: 06-25-2013, 01:53 PM
  5. Replies: 14
    Last Post: 03-19-2013, 12:16 AM

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