Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Save multiple values in a table field

Status
Not open for further replies.

Svenzardda

Instructor
Nov 29, 2004
1
LU
Hello,
I am new here, so please be kind with me!
Here is my question: I have a table with a 'Hobby' field. Linked to this field is a 'Hobbies' table. It is no problem using the wizard to make a dropdown list but I would like to use a ListBox instead. The question is: how can I save multiple values in the Hobby field from the 'Hobbies' table! I knwow VBA if required to. I know this goes a bit against the relational rules but instead of creating 10 hobby field, I could spare some times...
Many thanks in advance
 
Not sure that this is a good idea. However, you could make each selection in your list box concatenate to a string, perhaps with some form of delimiter character (like a | symbol) between each value. Then when you've finished selecting, update your hobbies field with this string.

[pc2]
 
Why would you want to break the normalization rules? I would expect to have:

tblPerson
PersonID
PersonFName
PersonLName

tblHobby
HobbyID
HobbyName

tblPersonHobbies
PersonID
HobbyID

This way each person can have unlimited number of hobbies.

What are you thinking about doing instead?

Leslie
 
I agree with lespaul. Although it can be done (using a concatenated string or similar method), I don't believe it should be done. In the long run, it is less work to normalize.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top