Results 1 to 8 of 8
  1. #1
    BDibz is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Feb 2018
    Posts
    62

    "EditRecord failed" error, but can't find any cause

    The full text of the error is "EditRecord failed because the default alias represents a record which is read only."

    This occurs when submitting the first Userform in a series of 6 forms - the first one generates a Serial Number, which is the Primary key for the table. The following forms add more data to that same Serial Number entry, and don't generate this error. The Serial Number is manually entered into the first form box and then written to the table when submitted. No custom code in this form at all, besides a BeforeInsert timestamp, but removing that code completely still generates the same error upon submission.

    All of the form data still writes to the database upon form submission. Nothing is actually going wrong or misbehaving beside that error pop up.



    Any suggestions?

  2. #2
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    Use google to get some information.

    I used
    ms access EditRecord failed because the default alias represents a record which is read only

    with google and found that others have had the problem. You may find a solution in the results that works for you.

    The sample solution in this result link may apply.

    The responders are very well informed Access developers.

    See post #13 by AccessJunkie (Jeff Conrad) for more info on data macros.

  3. #3
    BDibz is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Feb 2018
    Posts
    62
    I've looked through a lot of those solutions, and it tends to be that they use AfterUpdate/AfterInsert instead of BeforeUpdate/BeforeInsert, which I have avoided doing. However looking at my Application Log shows that there is an AfterInsert event that is causing the error every time; the problem is, I have no idea how to find it. I have combed every field and module to find an After Insert event, but I can't find any. Is there any way I can pinpoint the actual code that is causing this?

    Here is the last error recorded, which is generally the same as the others
    ID SourceObject Data Macro Instance ID Error Number Category Object Type Description Context Created
    31 t_23071095.AfterInsert {D0795E97-D8E2-49F5-8864-7E7346D3A454} -20335 Execution Macro EditRecord failed because the default alias represents a record which is read only. EditRecord 2/8/2018 9:46:08 AM

  4. #4
    orange's Avatar
    orange is online now Moderator
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,716
    I don't have any info re options. I would look at the info by AccessJunkie thoroughly and see if anything applies. He is the guru.

  5. #5
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Try changing your option to Break On All Errors. It might pinpoint the source of the procedure you're looking for. Not sure because I don't use macros. Not sure how you'd find it otherwise when it's in an embedded macro. You could also try a compact/repair in case this is a "ghost" left over from something you've deleted.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  6. #6
    BDibz is offline Advanced Beginner
    Windows 7 64bit Access 2016
    Join Date
    Feb 2018
    Posts
    62
    Honestly not sure what menu I found my way to, but upon going through just about every macro-related option in the ribbons I found something that showed all the macros that existed in the database and was able to clear a rogue InsertAfter that was causing this. Case closed! Thanks.

  7. #7
    Micron is offline Virtually Inert Person
    Windows 7 32bit Access 2007
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    I learned something about macros today. Probably won't stick though - a lack of use thing.

  8. #8
    RATSOFT56 is offline Novice
    Windows 10 Access 2021
    Join Date
    Aug 2023
    Posts
    1

    solucion !!!!

    [QUOTE=BDibz;387125]Revisé muchas de esas soluciones, y tiende a ser que usan AfterUpdate/AfterInsert en lugar de BeforeUpdate/BeforeInsert, lo que él evitó hacer. Sin embargo, mire mi registro de aplicación muestra que hay un evento AfterInsert que está causando el error cada vez; El problema es que no tengo ni idea de como encontrarlo. He revisado todos los campos y módulos para encontrar un evento After Insert, pero no puedo encontrar ninguno. ¿Hay alguna manera de que pueda identificar el código real que está causando esto?

    Aquí está el último error registrado, que generalmente es el mismo que los demás
    IDENTIFICACIÓN Objeto de origen ID de instancia de macro de datos numero erroneo categoría tipo de objeto Descripcion Contexto Creado
    31 t_23071095.Después de insertar {D0795E97-D8E2-49F5-8864-7E7346D3A454} -20335 Ejecucion Macro EditRecord falló porque el alias predeterminado representa un registro que es de lectura en solitario. EditarRegistro 8/2/2018 9:46:08 a.m.
    [/CITA]
    Click image for larger version. 

Name:	Captura de pantalla 2023-08-12 115710.jpg 
Views:	11 
Size:	17.2 KB 
ID:	50642

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

Similar Threads

  1. Replies: 10
    Last Post: 11-26-2018, 02:25 PM
  2. Replies: 3
    Last Post: 05-15-2015, 04:19 PM
  3. "Run Time Error 3146, ODBC call failed" :(
    By selvakumar.arc in forum Access
    Replies: 0
    Last Post: 12-04-2014, 01:57 PM
  4. Replies: 4
    Last Post: 11-05-2013, 03:46 PM
  5. "Group By" causes "ODBC--Call Failed" error
    By kaledev in forum Queries
    Replies: 1
    Last Post: 03-09-2011, 02:43 PM

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