Link to home
Start Free TrialLog in
Avatar of Akhater
AkhaterFlag for Lebanon

asked on

How to create a multivalued field using Access SQL

I need to alter a table and add a field that can hold multiple values but I need to this using Access sQL statement / VBA not the GUI

Once the constraint is created I am unable to set the "allow multiple value" field

how can this be achieved programatically ?

thank you
Avatar of Pawan Kumar
Pawan Kumar
Flag of India image

to go to SQL view use below

MS ACCESS SQL View -> http://www.jaffainc.com/SQLStatementsInAccess.htm

You can use SQL to do that-

ALTER TABLE  yourtableName
   ADD COLUMN yourCOLUMNName Text(30) /* Datatype(Size) ---- You can change as per your need*/
Avatar of Akhater

ASKER

Pawan did you even read my question ?
Akhater - Can you explain what you need ? The question is not clear to me if the last comment is not valid.
Avatar of Akhater

ASKER

I need to create a MULTIVALUED field by sql / vba what is not clear?
ASKER CERTIFIED SOLUTION
Avatar of John Tsioumpris
John Tsioumpris
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Akhater

ASKER

Thank you, I still need to sort a few glitches but it works

Cheers
Personally, I would strongly discourage multi-valued fields.  They may seem helpful, but when you start trying to write queries or reports and want to filter on that column it becomes a nightmare.

You are far better off creating the lookup table with the values, and the joining table which contains the PK from your main table, the PK from the lookup, and a Yes/No field, and then creating a subform to make your selections.  This will make it far easier to create reports and queries which rely on that "column" of data.