Form Questions

B

benbanyas

I have a problem that I hope can be fixed by one of two solutions.
On a Form, I have a "Keywords" field for labeling items being entered into a
database. Some items have over 10 keywords. Is there a way to create a
ComboBox that will show a list of possible keywords where many of them can be
selected in the same field?

I would prefer to not have multiple "Keyword" fields, so if the above is not
possible how can I display the list on the form for the user to view and so
it is automatically updated when I update the list? I tried doing this by
importing an Excel file as an object and linking it, but the list did not
update on the Form when I changed it in Excel.

Another ComboBox question, if I have 3 of the same(Such as three "Ben
Banyas") in my Source Column how do I make the ComboBox only show "Ben
Banyas" once in the drop down list and not 3 times?

Thanks for any help!
 
M

Mr B

Hi, benbanyas,

First, combo boxes cannot have multiple selections made from them.

However, you can set a listbox to allow two types of multiple choices. When
you have a listbox on a forn, take a look at the "Mulit Select" property of
the listbox. To process the choices made from the list box, you will have to
use VBA code. Ther are several threads here on the newsgroups that provide
such code.

As for your second question, I am assuming that you are using a query (sql
statement) as the record source for your combo box. You will need to set the
Unique Records property of your query to Yes. This will prevent the display
of duplicate values.
 
D

Douglas J. Steele

Combo boxes are limited to single selection. To get multiple, you must use a
list box with the MultiSelect property set appropriately. However, not that
you should not store multiple keywords in a single field: it makes querying
the data much harder (among other problems). In fact, you cannot bind a
multiselect list box to a field. Instead, you should have a second table
related to your existing table, with each keyword being a separate row in
the second table.

As to your second question, use the DISTINCT keyword in the query you're
using as the RowSource for the combo (or list) box.
 
B

benbanyas

for the last part, I am using a table, not a query as the RowSource. Is there
anyway to use the Unique Records or DISTINCT function as is or will I have to
create a query and make that the RowSource?
 
D

Douglas J. Steele

Create a query. Since you presumably want the records in the combo box
presented in a specific order, that's the only way you can ensure that.
 
B

benbanyas

Thanks so much, it works now!

Douglas J. Steele said:
Create a query. Since you presumably want the records in the combo box
presented in a specific order, that's the only way you can ensure that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top