adding a multi-valued field in a form

Naqibullah

Registered User.
Local time
Tomorrow, 03:21
Joined
Feb 7, 2013
Messages
86
Dear friends,
i really thank you all for your continous support,
i have question, hope i receive a favorable answer
how to add a multi valued fields in a form for example a student may have multipe hoppies, access can do this using using lookup option, but access stores multiple values in one field which is difficult to analyze, please give the best and efficient way of adding multiple option

Regards
 
Microsoft Access has this marvelous facility called sub-forms, they are designed to handle the information as you have explained. You will need a student table "tblStudent" and you will need a hobby table "tblHobby" and you will need a table to record which student is taking which Hobby. Have a Main form in which you select the student name, have a subform on this main form, based on the student hobby table. Basically I already explained something very similar in a recent post here:-
 
really thanks for your reply,
i couldn't figure it out, can u plz give me a simple practical example, i mean plz send that db example
regards
 
Great job thanks for the reply,
but i want these hobbies to be in the form of check boxes, assume i have a user friendly form having these data
studentName
Student hobbies (a group of hobbies in form of check boxes)
student training attended ( a group of trainings in form of check boxes the student attended

Regards
 
Then you need my "Automatically add a Checklist to MS Access" YouTube PlayList.

Automatically fill a "Check List"
Sometimes you need a checklist in your MS Access database. You might be tempted to do this by creating a set of fields across in your table, however this is not considered good design. A better way would be to have a table which automatically fills with the "check items"....

Kept Simple
In this article I would like to demonstrate one method of achieving this. I will try and keep the terms I use to describe this process as general as possible, so that it is easy to relate to the structure in different circumstances.

The Checklist Used
In searching the Internet for checklists, it took me a while to find one that fitted my needs, unfortunately it was a "Wedding List". I apologise if my choice terrifies any gentlemen reading this.

3 Tables Required
The minimum number of tables required to make this work is 3 tables, I have given these generic terms: master, data and list. To explain the use of these tables I will refer to a specific case. Consider a business which manages weddings for couples.

In this case the master table "tblMaster" will contain details about the "wedding planners" customers.

The data table "tblData" will store the data for each individual customer.

Finally a table "tblList" that lists the "check off" items that need to be transferred to the data table "tblData".

The transfer of the list into the data table is performed by just two functions "Copy List" fCopyListToData, and "Append List" fAppendListToData. There are several other supporting functions in this example.

fCopyListToData puts the data from the list (tblList) into a recordset and then loops through the record set extracting the Row information from each field, then transfers that information via the function fAppendListToData into the data table "tblData".

"tblData" is what this code is about, it is this set of data that is created. Looking at the data table (tblData) we have five fields: dataID, dataLinkID, dataSets, dataItems and dataTickedOff.

dataID is not necessary and can be ignored.

dataLinkID is used to relate the values in this table (tblData) to the master table (tblMaster).

"dataSets" would not be necessary if you only had one set of data in your list. It is quite common to have a list divided into separate sets of information so in that instance it would be required and really for a single list with only one set, then you just add a "1" (or some other identifier) and treat it as if it was a set from a number of sets.

"dataItems" links back to the table list "tblList" and can be used to find the string value related to each item.

"dataTickedOff" is a boolean field which allows you to to flag whether a list item has been done, or not done.

I also produced these slides (presentation) on Google Docs:- | "List To Data" but felt they needed some extra explanation hence the first video, and then I thought what the hell ... do some more videos.

I'm now working on a set of videos showing how to add and display a set of multiple check Items. My YouTube Playlist "Adding Multiple Checklists to MS Access" is now available...

Originally posted here:-
http://www.access-programmers.co.uk/forums/showthread.php?t=263639
 
Last edited:
thank you so much for your detailed explanation, one of the member of this forum sent me a database example showing how to add multiple check boxes in form, but there were to function i couldn't understand if it is possible help understand that database, attached please find the example
 

Attachments

You need to contact the member who sent you the dB
 

Users who are viewing this thread

Back
Top Bottom