Results 1 to 3 of 3
  1. #1
    scottnew2ac is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    2

    After Insert macro not functioning

    I'm trying to calculate a numeric value of a field based on the value of another field as a row is created using an "After Insert" macro. To test this I've created a table which has two integer columns "NUMBER1" and "NUMBER2". The macro was defined using the wizard as:

    Code:
     EditRecord
                SetField
                   Alias
                   Name  NUMBER2
                   Value = 5+[NUMBER1]
              End EditRecord
    NUMBER2 is not populated when I enter a value in NUMBER1
    I get the following in USysApplicationLog:
    Error Description
    -20335 EditRecord failed because the default alias represents a record which is read only.

  2. #2
    tanvi is offline Competent Performer
    Windows XP Access 2010 32bit
    Join Date
    Mar 2012
    Posts
    100
    I read this issue on many forums & found it is hard to solve. Read this:
    http://blogs.msdn.com/b/access/archi...-triggers.aspx
    You cant use after update to update the record you need to use before!!

    Ref: http://answers.microsoft.com/en-us/o...b-5c08fd159df7

  3. #3
    scottnew2ac is offline Novice
    Windows XP Access 2010 32bit
    Join Date
    Jul 2012
    Posts
    2
    Thanks, using "Before Update" resolved the issue, though having to focus on the field then tabbing over it wasn't quite how I invisioned this working. But I at least understand what's going on. Thanks again !!!

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

Similar Threads

  1. INSERT query: insert new data only
    By drh in forum Access
    Replies: 2
    Last Post: 04-04-2014, 05:31 PM
  2. Replies: 8
    Last Post: 08-02-2012, 08:48 AM
  3. DLookup not functioning correctly - any ideas please?
    By shabbaranks in forum Programming
    Replies: 2
    Last Post: 02-02-2012, 09:09 AM
  4. Runtime error not functioning A2007
    By gg80 in forum Programming
    Replies: 11
    Last Post: 09-04-2010, 01:24 PM
  5. Insert a picture with macro
    By KWarzala in forum Forms
    Replies: 8
    Last Post: 09-23-2009, 08:43 AM

Tags for this Thread

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