add multiple data in one field....??????

amra01

Registered User.
Local time
Today, 15:40
Joined
Oct 7, 2003
Messages
15
hi i am new here
i have this problem i want to add multiple data in one raw, using checkboxes and text boxes example:

known languages:
[checkbox]german :::[checkbox]french :::
[checkbox]english :::[checkbox]italian :::
[textbox]...........(null for other known languages

and i want all these to be added in one field like this: german, french, suahilli
if these are what is been selected.
this is easy made using html and php but now with access i can't get it...
 
By doing that you are breaking First Normal Form. A cell in a field should be atomic; no repeating groups and no composite attributes.
 
Mile-O-Phile said:
By doing that you are breaking First Normal Form. A cell in a field should be atomic; no repeating groups and no composite attributes.
thanks for your quick response but why a cell should be atomic? what should i do to accomplish that? you think i should add separate cells for each option i want?
i think it's easier for me to check the data this way data1, data2, data3 in one cell
 
No, even easier is to create a many-to-many relationship.

Consider the example in this thread where, instead of artforms (in the example) you substitute languages.
 
amra01 said:
i think it's easier for me to check the data this way data1, data2, data3 in one cell

That becomes a violation in itself as it is a repeating group and you should build a database down, not across. If you have Data 1 to Data5 then what happens when you need Data6? You are going to have to alter your table design, query design, form design, report design, etc.

If you have one field called Data and the records held in that field are like this:

Code:
[u]
DataField[/u]
Data1
Data2
Data3
Data4
Data5

With that table you won't require to alter any part of your structure.
 
you mean i should create a seperate table for each situation i have like this with the multiple choices...instead of using checkboxes.
 
A table for languages as the language is not depandant upon the table you currently wish to store it in.

I don't know what yur other table is but you need to create a table to join them.
 
thanks but this is to complex...
i understood it but i will have too many tables and relations between them...
is there any code to store each value of the check boxes in one cell seperated by a coma?
data1, data2, data3....
 
this is an html file
i want in access these to be added in on single cell each one seperated by a comma
(data1, data2,....)
 

Attachments

Before you "mush" the data into a single table column, you need to examine what the data will be used for. When your tables are properly normalized as the previous posters have pointed out, simple queries and crosstabs willenable you do do much of your analysis. If you "mush" the data, you'll need to resort to VBA to store the data and to get it out. So once you work out the code to "mush" it, you'll also need to work out the code to take it from the "mushed" field and set the unbound checkboxes. Then there's the analysis issues.............

The code is simple enough to write but Relational databases do not support non-atomic fields so you will find no functions to help you.

SomeField & "," & SomeField2 & "," & SomeField3 ......
 
can you give me an example i know for you it's easy but i can't figure it out.....
i put this in row data of the field?
and what somefield1, somefield2....means?

i am talking about several check boxes that you can select all of them and store one single value at one cell that will look like this: data1, data2, data4.....

and i have one table and one form i don't want seperate tables and stuff.
cause they will be so many tables it would be confusing.....
 
What you are doing is poor practice. I gave you an example of the code required to concatenate three fields separated by comas. I don't have any examples of working code because I would never do this. Here it is again worded differently:

SomeMushedField = YourCheckBox1 & "," & YourCheckBox2 & "," & YourCheckBox3 ......

You can put code like this in the Form's BeforeUpdate event. However, since you can't use a bound field to display the data, you will need to de-mush the field in the form's Current event and set the checkboxes properly.

You can take a look at this sample db to see how many-to-many relationships are properly implemented:

http://www.access-programmers.co.uk/forums/showthread.php?s=&threadid=40821&highlight=manytomany
 

Users who are viewing this thread

Back
Top Bottom