Results 1 to 6 of 6
  1. #1
    New Lounger
    Join Date
    May 2004
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Subform Problem (2000)

    Hello -

    I have a table of programs that has a 1 to many relationship with projects. I have a screen (see attached) in which the top (programs part) is a form and the bottom (projects) is a subform. All works fine and tables update successfully except when I create a new project (after creating the program) and I enter the estimated project cost in the subform within the project subform. I get an error box saying the changes you requested were not successful because they would duplicate values in the index primary key or relationship.

    My query for the estimated project cost subform just contains the project key and the project cost elements. I've tried adding the program key also but get the same results. Funny thing is if I don't enter estimated project cost numbers and create a new project cost record then go back to the prior one then I can successfully enter the estimated project cost. Make me think it is some kind of refresh issue but I tried adding a refresh (requery) in and it still doesn't work. (I've verified that the project table entry is on the table prior to entering project cost)

    BTW, the Program cost estimate on the top part of the screen works successfully.

    Any help is appreciated.

    Howard
    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Subform Problem (2000)

    Your screenshot is not enough to be able to help (for me, at least). We would have to know more about the way the form/subform/subsubform chain is linked together - what are the master and child link fields, are the master link fields AutoNumber fields etc.

  3. #3
    New Lounger
    Join Date
    May 2004
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Subform Problem (2000)

    <font color=blue>Edited by WendellB to activate link (see <!help=19>Help 19<!/help>) </font color=blue>

    For the additional information showing table relationships, linkage, etc. go to this link.... http://users.rcn.com/glossygal724/added info.doc


    Thanks
    Howard

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Subform Problem (2000)

    The query "cost proj query" that acts as record source for the "Estimated Project Cost" subsubform seems to contain a lot of fields from the "initiatives" table - or are they just fields with the same name? The record source for the "Estimated Project Cost" subsubform should have only the link field in common with the record source of the "IT Projects" subform; that link field should be "key initiative", since it is the unique key in the "initiatives" table; you don't need "key program" here.

  5. #5
    New Lounger
    Join Date
    May 2004
    Posts
    12
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Subform Problem (2000)

    The query "cost proj query" contains just the fields from table "initiatives" being updated in the "Estimate Project Cost" subform and the link field of "key initiatives". I changed the link field to be just "key initiative" but it still does not work. I updated the information on the link for this.
    http://users.rcn.com/glossygal724/added info.doc

    Thank you,
    Howard

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Subform Problem (2000)

    If both "IT Projects" and its "Estimate Project Cost" subform are based on the "initiatives" table, that makes no sense. You cannot base a form and its subform on the same table. That will lead to conflicts, as you have found. If "Estimate Project Cost" should be based on "initiatives", just place its controls on "IT Projects" and throw away "Estimate Project Cost". Otherwise, I don't understand your design.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •