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!

List in single entry

Status
Not open for further replies.

purpledawn

Programmer
Jun 21, 2001
50
US
Hi

I am going to make a form that will show a list of 'keywords', and the user will be able to select multiple keywords from that list to describe a record.

The problem that I'm having is that can't think of a way to save a list within a single entry. For example, from a list of keywords, the user chooses 'apples', 'oranages' and 'bananas' as the three keywords that best describe that record. What I want the user to see when they view the record later, is a list box with those three elements in it where they can add or delete elements, but not edit them.

I'm thinking of making two list boxes side by side, kind of the same idea that the Form wizards use to get you to select fields for that form.

I could simply write the keywords to a text field and separate them with commas or semicolons or something. But the problem is that the user could mess up this format when editing the contents of the text box (which they would have to be able to do to remove keywords), and that would make queries on 'keywords' be ineffective.

If anyone has any suggestions about this please let me know. If my explanation of what I'm looking for has left you scratching your head, please ask me questions so I can better clarify myself.

Thanks.
 
The answer is DON'T save them as a single entry.

I would suggest a sub table of 'selected key words'. From the list of available key words create records in the new sub table as key words are selected. You can use this table to format a text box on a form as needed. That text box should not be editable: instead they can again select from the list or delete from the sub table.

Using the sub table you will be able to query to your heart's content. And you'll be more normalized to boot!

You sound like you know how to do this, so hopefully this will point you in a new direction.

"The Key, The Whole Key, and Nothing But The Key, So Help Me Codd!"
 
Hi. Thanks for your help.

I'm not sure if I've gotten exactly what you mean by a sub-table, but this is the solution I've come up with:

Code:
Keyword          Citation          sub-table
table            table

KeywordID        CitationID        CitationID   KeywordID
---------        ----------        ----------------------
   1                 1                   1          1
   2                 2                   1          3
   3                 3                   1          4
   4                 4                   2          3
   5                 5                   2          5

The keywords for each citation will be shown in a List Box on the form, rather than in a Text Box as you suggested. If you have a compelling arguement for using a Text Box instead, please let me know!

Thanks.
 
You've got it!

There's no reason to use a text box. I think I read your message too fast, I thought you were talking about a text box, but you actually said field. If your users are happy with the list of keywords instead of the text box, by all means, don't go to the trouble of using the text box.

"The Key, The Whole Key, and Nothing But The Key, So Help Me Codd!"
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top