One slight modification would omit the row for Sm or Med if the value
might be NULL:
SELECT [RA Number], ProductID, "Sm" As Size, Sm
FROM MyTable
WHERE Sm IS NOT NULL
UNION ALL
SELECT [RA Number], ProductID, "Med" As Size, Med
FROM MyTable
WHERE Med IS NOT NULL
In some cases this can be useful. It causes missing data (NULLs) to
be changed into missing rows.
This is commonly called a "normalizing UNION" query because it can be
used to create a normalized (good database practice) from
"spreadsheet" data (bad database practice). If you wanted to add
another set of data for "Lg" you would not need to modify the table.
This brings up the point that, if you want your data stored this way,
you should probably have another table of "Sizes" in which you put
"Sm" and "Med" along with any new sizes added later.
It is rather easy to convert back to the format with columns for "Sm"
and "Med" so it is best to store the data in normalized fashion.
Converting the other way, to normalized fashion from unnormalized, is
a bit of a problem.
Tom Ellison
Microsoft Access MVP
Ellison Enterprises - Your One Stop IT Experts
Try a union query:
SELECT [RA Number], ProductID, "Sm" As Size, Sm
FROM MyTable
UNION ALL
SELECT [RA Number], ProductID, "Med" As Size, Med
FROM MyTable