Update a multivalued field in Access 2007

T

tzs

Is it possible in Access 2007 to update a multivalued field with a query?
How does it work? Can you update from a normalized table to a multivalued
field?

TZS
 
A

Albert D. Kallal

You can both use sql selects, and updates...

eg:

SELECT FirstName, LastName, MyColors
FROM Table1;

FirstName LastName MyColors
David Smith Blue
albert kallal Blue, Green

So, in the above, the "mycolors" is a multi- valued list of a persons
favorate colors. (and, for simple sake, this is another talbe, but the
primary key is not a id..but is the actual color name).

Lets change Blue to Red.....

UPDATE table1 SET MyColors.[Value] = "Red"
WHERE MyColors.Value = "Blue";

Now, lets select again:

SELECT FirstName, LastName, MyColors
FROM Table1;


FirstName LastName MyColors
David Smith Red
albert kallal Green, Red

So, yes, you can run selects, or updates on that mult-valued field.
 

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