Combo-box problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kevin Barnard

    Combo-box problem

    I'm having trouble with a combo-box drop down list.

    I have created a combo box drop down list of my suppliers on a form. This
    form uses just one table. The problem is that the drop down lists every
    entry I've made in that field on the table. So I have the same suppliers
    name repeated several times on the list. Obviously this is very clumsy. How
    can I limit the list so that each suppliers name appears just once?

    Thanks for the help.


  • Bob Quintal

    #2
    Re: Combo-box problem

    "Kevin Barnard" <randhedge@hotm ail.com> wrote in
    news:biohlf$p5a $1@ctb-nnrp2.saix.net:
    [color=blue]
    > I'm having trouble with a combo-box drop down list.
    >
    > I have created a combo box drop down list of my suppliers on a
    > form. This form uses just one table. The problem is that the
    > drop down lists every entry I've made in that field on the
    > table. So I have the same suppliers name repeated several
    > times on the list. Obviously this is very clumsy. How can I
    > limit the list so that each suppliers name appears just once?
    >
    > Thanks for the help.
    >[/color]
    You need another table. Call it suppliers. Put the supplier's name,
    address, phone, salesman's name in it. Add another field called
    SupplierID. Once that's done, add the supplierID to the table that
    feeds your form. Remove all the supplier info in that table.

    Change the ComboBox's rowsource property to the new table,
    suppliers. Make the combobox two columns wide, [supplierID] and
    [SupplierName]. You can make the supplierID column's width 0", so
    that it doesn't show.

    The combobox you have, if you built it with the wizard, should list
    each supplier once, if the spelling (including case, leading and
    trailing spaces is identical).

    In my opinion you'll spend less time building the new table than
    fixing the problems in the existing one. You'll also get a faster
    acting listbox, and it'll be a lot easier to manage when you get
    1000 different suppliers.

    Bob




    [color=blue]
    >[/color]

    Comment

    • MGFoster

      #3
      Re: Combo-box problem

      -----BEGIN PGP SIGNED MESSAGE-----
      Hash: SHA1

      Hi,

      Change the RowSource of the combo box to a query like this:

      SELECT Supplier FROM tblSuppliers GROUP BY Supplier

      MGFoster:::mgf
      Oakland, CA (USA)

      -----BEGIN PGP SIGNATURE-----
      Version: PGP for Personal Privacy 5.0
      Charset: noconv

      iQA/AwUBP0/pWoechKqOuFEgEQ IHlACgg7g9Cyk+Z F2K4ysQCzB6HI8Q uqYAnRSj
      FbaXTsLdhQgdmcJ N+/ZkasJk
      =ET5q
      -----END PGP SIGNATURE-----


      Kevin Barnard wrote:[color=blue]
      >
      > I'm having trouble with a combo-box drop down list.
      >
      > I have created a combo box drop down list of my suppliers on a form. This
      > form uses just one table. The problem is that the drop down lists every
      > entry I've made in that field on the table. So I have the same suppliers
      > name repeated several times on the list. Obviously this is very clumsy. How
      > can I limit the list so that each suppliers name appears just once?
      >
      > Thanks for the help.[/color]

      Comment

      Working...