Update Query on Multivalue field

The Archn00b

Registered User.
Local time
Today, 13:18
Joined
Jun 26, 2013
Messages
76
I have a multivalue field containing values of A,B,C and D with primary IDs of 1,2,3 and 4 in that order.

If I was to run:

Code:
UPDATE Table
Set Table.Multivalue.Value = 1
WHERE Field 1 = "True" AND Field 2 = "True";

Then run

Code:
UPDATE Table
Set Table.Multivalue.Value = 2
WHERE Field 1 = "True" AND Field 2 = "True";

Will I have a Multivalue field as A,B or just B? I would like it to be A,B but I have my doubts as to whether this would work. If it won't work could someone point me in the right direction to solve this problem? Thanks!
 
The Archn00b, Multivalued fields are a clear violation of the DB structure. The right direction is to re-design your table design. Lookup on Normalization.
 
No they're a supported feature. You can have a field that contains multiple values.
 
No they're a supported feature. You can have a field that contains multiple values.
I know that, MS introduced the MultiValued fields in Access 2007. It is a supported feature if you plan on using Access as an amature DB to store records. But as a RDBM designer, you need to look over and beyond. As many of us on here do not approve of using this feature, there might not be much help on this (atleast from me). Sorry.

That being said, the closest I have come across is this Article : http://office.microsoft.com/en-us/a...valued-fields-in-queries-HA010149297.aspx#BM8
 
Ah OK thanks. I understand now.

That's the article I started from. So do you use Junction tables instead of multivalue fields? I've heard the principle is the same, with a multivalue field just creating a junction table "behind the scenes."

What's the major problems with multivalue fields?
 
Bumping for replies. What's the problem with multivalue fields in your opinions?
 
Fundamental rule of any Relational Database is that you should not store multiple values in a single Column. There should be small article in my blog, regarding the fundamental of DB design, go through it.

As each piece of information needs to be stored as an element of its own. Although the design structure of this Multivalued column (as justified) stores the data in a perfectly normalized form. However this is hidden from the users view. In other words, the table that stores the data is hidden in System tables and what you see is not what it is actually stored. So it makes any operation such as SELECT/UPDATE more complicated. As your situation is right now.

This is one of the main disadvantage of using multivalued fields. You do not know what data you are dealing with.
 
OK I've solved the problem, but I have another question:

Querying a multivalue field.

A have a query that selects the multivalue field. The query forms the record source for a subform. The text values in the multivalue field are displayed in the query, but when I save this and view the data in the subform datasheet view the values revert to the primary key values. They are 1,2,3,4 instead of the text values. Does any one know what is going on?
 

Users who are viewing this thread

Back
Top Bottom