Solved

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

Posted on 2013-02-07
11
404 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 4
11 Comments
 
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
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 20

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 20

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
 
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 20

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 20

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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

717 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