Error when Adding Record to Linked Subform

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andante.in.Blue

    Error when Adding Record to Linked Subform

    Hi everyone! In Access 97, I have a parent form and a subform that
    are both based on the same query. The main form is continuous and
    serves up a summary for each record. The subform provides details on
    the record and is linked to the parent record via an autonumber ID.

    My users want to be able to add new records to the table underlying
    the main query (the query is structured so that new records can be
    added via its database view). I added an "Add New" button on the
    subform that calls "DoCmd.GoToReco rd , , acNewRec". The button works
    fine, but upon dirtying the form, I get the error: "You can't assign a
    value to this object", suggesting that the form may be in read only
    mode, or is open in design-view, or value is too large for the field
    -- none of these are true.

    After the error msg, I can enter values as I please and it is
    correctly saved to the underlying table.

    Any ideas as to why I getting this error (I suspect it is because the
    link between the forms is broken as the main form is currently on a
    pre-existing record, while the child form is on the new record). More
    importantly, any ideas as to how to get Access to do this without
    complaint?

    Thank you for any suggestions you may have. This newsgroup has been a
    treasure trove of altruistic experts.

    Alan
  • Andante.in.Blue

    #2
    Re: Error when Adding Record to Linked Subform

    I've tried a few more things and I've discovered that if I unlink the
    parent and child forms, the add button works fine. But if I filtered
    the main form on some criteria, and then tried the add new button, I
    would get a "You cannot go to the specified record. You may be at the
    end of a recordset." error; after which the main form becomes
    unfiltered and clicking on the add new button has the desired result.

    Any ideas?

    Alan

    Comment

    Working...