Results 1 to 5 of 5
  1. #1
    panoss is offline Advanced Beginner
    Windows 2K Access 2003
    Join Date
    Oct 2014
    Posts
    59

    Saving a record with VBA does't trigger Form's AfterUpdate event

    I have a form, Form2, which I open with Data Entry = true, to add new record.
    I add a new record in Form2 and click Save button, which saves the record Form2.
    With: DoCmd.RunCommand acCmdSaveRecord

    BUT this doesn't trigger the Form2.AfterUpdate event (I know it's not supposed to be triggered when saving with VBA).
    Is there a way to trigger this event?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    No it wont trigger with vba, YOU must do it with vba.
    add another line after the SAVERECORD

    form_Afterupdate()

    (to call the afterupdate)

  3. #3
    panoss is offline Advanced Beginner
    Windows 2K Access 2003
    Join Date
    Oct 2014
    Posts
    59
    'Compile error: Syntax error'

    The code is: Forms![OrderDetails]![OrderDetailsSubform].Form_AfterUpdate()

    ( the code is in Form2.)

    It's the subform of the Form 'OrderDetails' that has the AfterUpdate routine that I want to call.

  4. #4
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    you dont trigger if from the main form.
    you do it in the form you are editing.

  5. #5
    panoss is offline Advanced Beginner
    Windows 2K Access 2003
    Join Date
    Oct 2014
    Posts
    59
    You mean I can't trigger another form's event!

    But that's what I want!

    I want from Form2 to trigger the event in OrderDetailsSubform.

    I can't??

    EDIT: I made the event public, but still doesn't work!!

    I tried this: "call Form_OrderDetails.OrderDetailsSubform.Form.AfterUp date"
    Resulted an error:Compile error: Invalid use of property.

    Edit2: Form_OrderDetails.OrderDetailsSubform.Form.Form_Af terUpdate this works!!!

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

Similar Threads

  1. Event trigger at loading each record
    By xcheshirecat in forum Forms
    Replies: 5
    Last Post: 06-12-2014, 10:11 AM
  2. Replies: 8
    Last Post: 06-05-2014, 12:08 PM
  3. event to trigger after new record
    By richlyn in forum Access
    Replies: 1
    Last Post: 03-02-2012, 10:26 AM
  4. Replies: 7
    Last Post: 01-02-2012, 06:19 PM
  5. Replies: 2
    Last Post: 07-24-2011, 08:50 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