Combo box

D

Don

I have a combo box that is based on a SELECT query as follows:

SELECT InstitFactories.InstFactNum, Factories.FactoryName,
InstitFactories.Quota, InstitFactories.Shifts
FROM Factories INNER JOIN InstitFactories ON Factories.FactoryID =
InstitFactories.Factory;


In the query "InstitFactories.InstFactNum" is the PK in the InstitFactories
table and "Factories.FactoryName" is the PK in the Factories table. (This may
not matter)

The result of the SELECT query is 7 records. Of these records three have the
same value for the field "Ouota" which the value in each is 120. When
selecting any of the three records with this same value, the combo box only
allows the first record with the 120 value. Combo box example:

Factory Quota
Laundry 80
Shoe 120
Maint 10
Optical 120
Bakery 76
Whse 120

When Optical or Whse is selected from the combo box list, only Shoe is
returned in the combo box field.

When I change the "Quota" values to be unique in the table, the combo box
allows any choice in the list. The problem is that in real life the values
are not unique.

Does anyone have any ideas why this is and how I can correct this issue?

Thanks,

Dennis
 
O

Ofer Cohen

It's depend on the value you want to store, which in your case is the
InstitFactories.Quota, the third column.
It doesnt make sense storing a value that repeat it self, you need to bound
the combo to a field that doesn't repeat it self.

in your case if you store 120, how can Access know which Factory you are
looking for?
 
D

Don

The 120 is a number that should only be stored for use for another query to
complete a calculation. How does Access care what number it is or try to
regulate which number is stored in an unbound field? There is no primary key
(PK) and the field in the table allows duplicates. Since the 120 is a record
and not an PK how can there be a conflictor confusion?
 

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