2 ID's 1 Product Name

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Thanks for taking the time to read my question.

I have a product list that has an ID for every product. Each product has a
name and a size. I have a combo box on one form where size doesn't matter
(ha ha ha) but I need to limit the combo box list to only 1 of each product.
I need the ID as a hidden column so that I can stor it in the table.

ID Product Size
1 paint 1 Litre
2 paint 4 Litre
3 brush Small
4 brush Large

and so on...

I want my combo box to list:
paint
brush

I don't care what ID I store. How can I do this? If I group each ID is
displayed, If I choose First, I get the First ID, and only one record.

I need one of each product name, and any associated ID.

SQL:
SELECT tblMVUP.ID, tblMVUP.ChemicalName, tblMVUP.Active
FROM tblMVUP
GROUP BY tblMVUP.ID, tblMVUP.ChemicalName, tblMVUP.Active
HAVING (((tblMVUP.ChemicalName)<>"") AND ((tblMVUP.Active)=True))
ORDER BY tblMVUP.ChemicalName;



Thanks,

Brad
 
OK I got it.

I make a pre-query:
SELECT tblMVUP.ChemicalName, Max(tblMVUP.ID) AS MaxOfID, tblMVUP.Active
FROM tblMVUP
GROUP BY tblMVUP.ChemicalName, tblMVUP.Active
HAVING (((tblMVUP.ChemicalName)<>"") AND ((tblMVUP.Active)=True))
ORDER BY tblMVUP.ChemicalName;

The problem here is that I need to store the ID and show the ChemicalName.
So in the combo box, ID has to be the first column, and ChemName has to be
the second column.

So the RowSource for the Combo Box is this query, but I put MaxOfID first,
then ChemicalName.

Presto.

If someone has something better i.e. no pre-query, let me know.

Thanks,

Brad
 
OK I got it.

I make a pre-query:
SELECT tblMVUP.ChemicalName, Max(tblMVUP.ID) AS MaxOfID, tblMVUP.Active
FROM tblMVUP
GROUP BY tblMVUP.ChemicalName, tblMVUP.Active
HAVING (((tblMVUP.ChemicalName)<>"") AND ((tblMVUP.Active)=True))
ORDER BY tblMVUP.ChemicalName;

The problem here is that I need to store the ID and show the ChemicalName.
So in the combo box, ID has to be the first column, and ChemName has to be
the second column.

So the RowSource for the Combo Box is this query, but I put MaxOfID first,
then ChemicalName.

Presto.

If someone has something better i.e. no pre-query, let me know.

Thanks,

Brad
 
OK I got it.

I make a pre-query:
SELECT tblMVUP.ChemicalName, Max(tblMVUP.ID) AS MaxOfID, tblMVUP.Active
FROM tblMVUP
GROUP BY tblMVUP.ChemicalName, tblMVUP.Active
HAVING (((tblMVUP.ChemicalName)<>"") AND ((tblMVUP.Active)=True))
ORDER BY tblMVUP.ChemicalName;

The problem here is that I need to store the ID and show the ChemicalName.
So in the combo box, ID has to be the first column, and ChemName has to be
the second column.

So the RowSource for the Combo Box is this query, but I put MaxOfID first,
then ChemicalName.

Presto.

If someone has something better i.e. no pre-query, let me know.

Thanks,

Brad
 
OK I got it.

I make a pre-query:
SELECT tblMVUP.ChemicalName, Max(tblMVUP.ID) AS MaxOfID, tblMVUP.Active
FROM tblMVUP
GROUP BY tblMVUP.ChemicalName, tblMVUP.Active
HAVING (((tblMVUP.ChemicalName)<>"") AND ((tblMVUP.Active)=True))
ORDER BY tblMVUP.ChemicalName;

The problem here is that I need to store the ID and show the ChemicalName.
So in the combo box, ID has to be the first column, and ChemName has to be
the second column.

So the RowSource for the Combo Box is this query, but I put MaxOfID first,
then ChemicalName.

Presto.

If someone has something better i.e. no pre-query, let me know.

Thanks,

Brad
 
Back
Top