Results 1 to 7 of 7
  1. #1
    RayMilhon is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,065

    Before Insert Event

    Does anyone know exactly when the Before Insert Event Fires? I have a table for Data entry. I'm trying to build a key for the table to allow linking from different systems since each system has it's own definition of a Primary key I want to set up a field that will include the first 4 characters of the last name the first 4 characters of the first name and the DOB in the format mmddyyyy. I know it's not foolproof but it's the best I can come up with based on the data available. The problem is that the Data is entered into our system manually from Paper sign in sheets. the form is linked directly to the Person table and I want to create this key after the 3 Fields are entered. The After Insert event is too late the data has already been saved. But I think the before insert Event is too early because I'm not sure when it fires. I'm presuming that it fires as soon as the first key strike is hit when on a new record. That's too soon because the required data isn't complete then. Thanks for any assistance.

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    the before insert event fires just before the data is inserted into the table

    If you are not sure, put some msgboxes in the relevant events to see the order of events and when they fire

  3. #3
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    See https://support.office.com/en-us/art...7-CE86553682F9

    Look for the section: "Order of events for records on forms"

    Then sub-section: "Creating a new record"

  4. #4
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    I've referred to that page many times. For this post, I find the explanation lacking since it's seems to be more about the event order for the form and not enough about the event itself. This page seems to have more about the event itself, and I quote
    "The BeforeInsert event occurs when the user types the first character in a new record, but before the record is actually created."
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  5. #5
    ssanfu is offline Master of Nothing
    Windows XP Access 2010 32bit
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Thanks for the link, Micron. I now have it bookmarked.

  6. #6
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    @micron - your link is correct - I withdraw my statement. I was thinking of the before update event

  7. #7
    RayMilhon is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2011
    Location
    Southern California
    Posts
    1,065
    Thanks @Micron that's what I was looking for. Also ssanfu Thank you for your link that will help as well.

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

Similar Threads

  1. Replies: 1
    Last Post: 08-29-2016, 07:50 PM
  2. Replies: 7
    Last Post: 05-08-2014, 10:34 AM
  3. Replies: 1
    Last Post: 03-29-2014, 07:46 PM
  4. Replies: 3
    Last Post: 05-07-2012, 12:17 PM
  5. Replies: 7
    Last Post: 01-02-2012, 06:19 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