473,387 Members | 1,711 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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.
Nov 12 '05 #1
2 5240
"Kevin Barnard" <ra*******@hotmail.com> wrote in
news:bi**********@ctb-nnrp2.saix.net:
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.
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




Nov 12 '05 #2
-----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/pWoechKqOuFEgEQIHlACgg7g9Cyk+ZF2K4ysQCzB6HI8QuqYAn RSj
FbaXTsLdhQgdmcJN+/ZkasJk
=ET5q
-----END PGP SIGNATURE-----
Kevin Barnard wrote:

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.


Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Harry Haller | last post by:
<select name="cboPlaces" id="cboPlaces"> <option value="3">Countryside</option> <option value="4">Forest</option> <option value="5">Mountain</option> <option value="6">Desert</option> <option...
1
by: Tina McGibben | last post by:
I basically have a form with a subform with two combo boxes on the main form which filter the subform. The code below works except I cant seem to get it to show all the worksheets when there is...
8
by: bbdata | last post by:
ok i have a problem here and not much time to play round. have a form bound to a table. one of the combos is bound to a field Agents. i have active and retired agents. thing is, i want to be able...
2
by: Al | last post by:
hi,I am using asp.net(vb) I am trying to create 3 combo boxes which are dependable on each other. when comb1 is selected, it shows the comb2 data based on the selection in combo1 and when combo2...
1
by: Alejandro González | last post by:
Hi I have a combobox binded to a Datatable something like combo.DataSource = dt.DefaultView; combo.DisplayMember = "descField"; combo.ValueMember = "valueField"; it works fine.
8
by: AA Arens | last post by:
Hi I do have a products table and products-parts table in my Access 2003 database and log all services into a form. I do have at least the following two combo boxes on my form: - Choose...
3
by: John | last post by:
AC2007 I changed my combo's row source and then the autocomplete stopped working. The combo is two columns, bound to the first. First column is primary key (ID). Second column is a...
2
by: Ruthenfods Tellez | last post by:
I have an application in asp; in my form I have a combo and a textbox, the combo is fill in from a database query. I cannot do the following: when selecting an item from the combo, it should send...
0
by: Jeff | last post by:
I don't remember this being that hard. Or maybe it's just early senility. On a simple bound continuous form I have a combo for filtering the form by customer. The form record source is a sql...
4
by: User | last post by:
Hi people, Excuse if my question is silly, but... i have 2 combo boxes in my project they are binded to fields from same table... one is binded do Code field and another to Description field...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.