Solved

How to store and retreive multilpe values in a multiselect List box in MS Access 2010

Posted on 2013-02-07
11
344 Views
Last Modified: 2013-02-07
Hi,

I have a multiselect List Box on a form in a MS Access 2010 database and I want the user to be able to select one or more values from the box (based on a customer's personal information).

Of course, I want this information (value selections) to save in a child table. Second, I want to be able to retrieve and display the same highlighted selections automatically based on that customer ?

How would I be able to achieve this task ?

Any help would be extremely appreciated.

Thank you !
0
Comment
Question by:Daniel Van Der Werken
  • 7
  • 4
11 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 38864952
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 38864971
But it is not clear what you are wanting to do here there...

<...I want the user to be able to select one or more values from the box (based on a customer's personal information)...
...Of course, I want this information (value selections) to save in a child table...
...be able to retrieve and display the same highlighted selections automatically based on that customer...>

Please explain in greater detail...
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 38864991
Perhaps it would be simpler for them to simply "enter" this info directly into the child table via a combobox...?
0
 
LVL 19

Author Comment

by:Daniel Van Der Werken
ID: 38865004
I have a combobox with 5 values that they may select from. These values are based on a device that a customer is using (for instance, a printer or a scanner or a fax machine, etc.). The user selects however many of these list items that the customer's device operates as.

I want that selection to save in a table and display in the form whenever the user brings up a customer's record.

So if there is a device that functions as a printer and a fax, and the user selects those two functions (and that selection is stored in a table), then I want that selection to display when the user pulls up that specific customer record.
0
 
LVL 19

Author Comment

by:Daniel Van Der Werken
ID: 38865010
I am still very new to DB programming and MS Access 2010 and unfortunately for me, the user has requested that they have selections rather than pure text entry fields.
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 38865219
Then this is a compound question.
Design
Build

Try this simple example first
Database89.mdb
0
 
LVL 19

Author Comment

by:Daniel Van Der Werken
ID: 38865294
I like your example but let me correct myself.

I have a *listbox, not a combobox. The listbox includes Fax, Printer, Copier, and Scanner.

I already have the listbox built to include those values and the user can select one or more of those. Based on the user's project requirements, one equipment device may actually include any of the features/functions contained in the listbox.

So if the user selected fax and printer for a specific equipment device, I would like that selection stored within a table. Without displaying any IDs on the form, how would I store that in a table ? When you actively select fax and printer from the listbox in the form, those values are highlighted in black. Is there any way that I would be able to display those values as highlighted when the record is displayed in the record ?

My apologies but I suppose this is actually a 3 part question:
1 ) How would a multiselection from a listbox be stored within a table ?
2 ) How can the info be retrieved in the form if the user wants to look at the record (without looking in the table) ?
3 ) How can I display the selection in the record form so that it appears highlilghted in black ?
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 38865337
You can do it but it may be a bit complex if you are new to:
Access
Form design
VBA

My combobox solution will work, ...are you saying that you want what you want regardless of the complexity and if you understood what was being done?
0
 
LVL 19

Author Comment

by:Daniel Van Der Werken
ID: 38865399
I have specific requirements from the user, unfortunately, but that's expected. A subform on a form won't quite work for what the client wants.

I have coded some of my DB. If you provide some code with explaination on what it does and where I should put the code and it should be fine.

Any suggestions for coding based on the 3 part question above ?
0
 
LVL 74

Accepted Solution

by:
Jeffrey Coachman earned 500 total points
ID: 38865422
Then these "specific requirements" will produce a non-standard/counter-intuitive interface that is prone to user missteps, thus requiring multiple levels of validation.

But here you go...
...in an event, I believe this addresses all of your concerns...

JeffCoachman
Database89.mdb
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 38865876
Thanks...

I did not want to seem like I was trying to give you a hard time.

Just that the design the customer wanted will probably lead to more questions..
:-(

For example
-How to stop the user from clicking the button twice?
-Creating the same system for "removing" devices?
-What happens if you are adding a new Customer?
...etc

Finally note that if you select the same device twice, it will alert you.
I added this validation in myself, ...if I didn't, you would have surely posted another question on how to prevent this...
;-)


Jeff
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now