R
roccogrand
How you import values from Excel into a multivalue field. I tried using
commas to separate the values.
Thx.
LDN
commas to separate the values.
Thx.
LDN
roccogrand said:How you import values from Excel into a multivalue field. I tried using
commas to separate the values.
Arvin Meyer said:Now modifications are necessary. So here's how you use the query to separate
the multi-value. In a new query, you would add the key and a columns with
the function:
ParseIt([MultiFieldName], 1, ",")
ParseIt([MultiFieldName], 2, ",")
ParseIt([MultiFieldName], 3, ",")
etc.
Add as many columns as you have maximum number of values. In other words, if
you have A, B, C, D you would add 4 columns, 1 for each value in the set.
The return for the query will look like:
ID Expr1 Expr2 Expr3 Expr4
1 A
2 A B C D
3 A B
You then run an append query to the new many-side table for each of the
columns. The final records in the new table will look like:
ID NewColumnName
1 A
2 A
2 B
2 C
2 D
3 A
3 B
Once that's done, create the relationship between the original table and the
new one on the Key (ID) column, test it to see if a query will give you
results from both, then delete your multi-valued column from the original
table.
Yes, you do want to lose the multi-value "functionality". You can always run
code and put it back if you use SharePoint, which is the ONLY possible good
reason to use muti-values. You will find that while it may seem easier to
just add a comma and a new value, that you are asking for trouble.
1. You will have numerous records where the user forgot to add a separator.
2. You may not be able to search.
3. If you can search, your searches will take many times longer.
4. You will never be able to upsize or change back-ends.
5. You will get unexpected results from queries.
It may not matter to you, but no really good professional programmer or
developer will ever want to work on your database.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
roccogrand said:Thanks Arvin,
If the valid values are set to being three characters long and are comma
separated, then can I modify your parsing routine and load the values into
the .Value field of a multivalue record. I would have to duplicate the
other
fields to maintain the multivalue functionality of the table.
Will that work? I really don't want to loose the multivalue functionality
that I have built into the application.
Thanks again.
LDN
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.