Results 1 to 7 of 7
  1. #1
    2 Star Lounger
    Join Date
    Sep 2007
    Location
    Chatham, Kent, England
    Posts
    214
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Combo box list items not unique (2000)

    My database holds records of documentation details.

    I have a form for entering details of a new document (ForDocDetails) which includes a combo box to select the document type from the document type table.

    Another form searches for documents in the database (ForSearch) based on the selection made in a combo box to list all the document types.

    After adding a new document to the database the document type chosen appears twice in the combo on the search form.

    What
    Attached Files Attached Files

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

    Re: Combo box list items not unique (2000)

    There are some tables missing from your demo, so the record source of the ForNewDoc form, QueNewDoc, can't be opened. If I remove the missing tables from the query design, I can add a new document without creating duplicates in the Document Type list. I cannot judge whether the missing tables have anything to do with it.

  3. #3
    2 Star Lounger
    Join Date
    Sep 2007
    Location
    Chatham, Kent, England
    Posts
    214
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo box list items not unique (2000)

    I've re-attached the zipped up database with some better deletion of the spare bits.

    There's a new document record with a document name of Woodys Test. added using the form ForDocDetails. The document type is Generic Health and Safety Plan which, as a result of adding the record of the document, has been added to the document type table as an additional document type ID 9 when it was already in there as ID 2.

    Any pointers gratefully received!

    Regards

    Graeme
    Attached Files Attached Files

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

    Re: Combo box list items not unique (2000)

    The DocType combo box is bound to the DocType field that comes from the TabDocType table. Instead, it should be bound to the DocTypeID field (from the TabDocDetails table), and the Bound Column should be set to 1 instead of 2. As it is now, you're saving the value in the wrong table.

  5. #5
    2 Star Lounger
    Join Date
    Sep 2007
    Location
    Chatham, Kent, England
    Posts
    214
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo box list items not unique (2000)

    Thanks Hans

    I've made the changes but the document type combo box on the ForDocDetails form now displays all the document names from the TabDocDetails table.

    I've tried changing the column count to 7, the doc type ID, but this then just displays the ID number, ofcourse!

    I thought about trying making the doc type ID field in the TabDocDetails table a lookup field but then I remembered the database ten commandments and the one which says "Thou shalt not use lookup fields!"

    Any thoughts?

    Regards

    Graeme

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

    Re: Combo box list items not unique (2000)

    You must have done something wrong here, perhaps you've got the wrong row source. See screenshots of the Format and Data tab of the Properties window for the combo box.
    Attached Images Attached Images
    • File Type: png x.png (13.3 KB, 0 views)

  7. #7
    2 Star Lounger
    Join Date
    Sep 2007
    Location
    Chatham, Kent, England
    Posts
    214
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Combo box list items not unique (2000)

    It all makes sense when it works!

    I read "Instead, it should be bound to the DocTypeID field (from the TabDocDetails table)" as meaning the row source should be TabDocDetails. So that's what I did without questioning!

    Thanks again

    Graeme

Posting Permissions

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