Record is deleted error when requiring a related sub-form, how to handle?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Michael R
    New Member
    • Nov 2006
    • 176

    Record is deleted error when requiring a related sub-form, how to handle?

    Hello.

    I have a form with 2 sub-forms in it. One is sfrmFormulation s, other is sfrmCategories. Logically, tblFormulations and tblCategories related on one-to-many basis and have delete and update cascade. In the form, they are kept related by on current event in sfrmFormulation s, which activates a requery in sfrmCategories.

    When I delete a record in sfrmFormulation s, I get the following error:
    Run-time error '3167'
    Record is deleted.

    Pressing the debug button, Access takes me to Form_Current sub, to the line:
    Code:
    Me.Parent.sfrmCategories.Form.Requery
    I need some help on how can I handle properly such an event.
  • nico5038
    Recognized Expert Specialist
    • Nov 2006
    • 3080

    #2
    Check:

    for some detailed information.

    Nic;o)

    Comment

    • steal32
      New Member
      • May 2008
      • 2

      #3
      I can only take a guess at the cause of the error as you have not listed any code that opens the query or explained in which event this is supposed to happen.To resolve this when you open the access table by using Visual Basic code, include the dbSeeChanges option, as in the following example:

      Set rs = db.OpenRecordse t("TestTable" , dbOpenDynaset, dbSeeChanges)


      The dbSeeChanges option ensures that any newly added records that contain a default value in the unique index field are available in the current recordset.

      If still you get error that means there is corruption in database so you must import your database to new blank one or use stellar phoenix access repair software to repair your database.

      Hope it helps

      Comment

      Working...