Results 1 to 6 of 6
  1. #1
    Adam7 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2012
    Posts
    20

    SubForm Causing Duplicates?

    Hi all,



    I have made a small sales database.

    Customer information from the customer table is on a main form, and on that is a subform that is from the orders table.

    So the idea is that the customer's orders appear on the subform.

    My problem is that if I enter more than 1 order in the subform, it makes a new record in the form.

    I.e. For the 1st record, if I put 2 orders, there will now be 2 records on the form.

    For some reason the record count in the bottom left is counting orders instead of customers, I think?

    Hopefully someone can work out what I'm trying to explain

    Any help appreciated,

    Thanks,

    Adam

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,529
    A picture might help, but unless you've hidden them the main form and the subform would both have record counters at the bottom. In the scenario you've described, I would expect the subform's to display 2.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    Adam7 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2012
    Posts
    20
    Quote Originally Posted by pbaldy View Post
    A picture might help, but unless you've hidden them the main form and the subform would both have record counters at the bottom. In the scenario you've described, I would expect the subform's to display 2.
    Ahhh, that may be it. The subform's counter is where I'd expect the main form's counter to be (I think).

    It's at work so will have to wait till tomorrow but I seem to remember hiding the main form's counter before I made the subform.

    Jeezz, how bloody simple. Thanks Pbaldy, that sounds spot on.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,529
    No problem, post back if you still have a problem.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    Adam7 is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Jun 2012
    Posts
    20
    Quote Originally Posted by pbaldy View Post
    No problem, post back if you still have a problem.
    Hi, I have scrapped that and decided to edit a similar form used for something else.

    It all works perfectly apart from when I change the name of the field that is the primary key.

    e.g. It used to be "customer ID", I change it to just "ID", and then when I try and open the form, I'm asked for a parameter with Customer ID.

    I'm not sure where the parameter is coming from, the form/subform are based on tables not queries.

    Thanks

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,529
    It could be A textbox bound to that field, or the Order By property, or perhaps the master/child links.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 4
    Last Post: 06-18-2012, 07:01 AM
  2. Query Criteria causing a headache
    By GavinBlackburn in forum Queries
    Replies: 2
    Last Post: 07-12-2011, 04:55 AM
  3. Reference Table causing row duplication
    By nbballard in forum Access
    Replies: 0
    Last Post: 06-23-2011, 10:48 AM
  4. Replies: 15
    Last Post: 12-03-2010, 10:14 AM
  5. Replies: 1
    Last Post: 05-27-2006, 12:35 PM

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