How to add selected items from a combo box to a listbox on a form (1 Viewer)

SparkieDEV

New member
Local time
Today, 04:13
Joined
Oct 13, 2020
Messages
26
I am looking for a solution to an idea I have.

I have a form and on it has a combo box. That combo box has a list of items related to that form's record. I want to have the ability to select an item on that combo box list and it adds itself to the Listbox on the same form. This should also allow me to add multiple items to the Listbox. I also want additional controls on the Listbox where I can remove selected items from that list at a later date for example.

Background:
I am continuing to build an asset management database. This form is used for creating new incidents on an asset. When creating the new form, I want to select up to multiple "childasset items" to the Listbox.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 11:13
Joined
May 7, 2009
Messages
19,228
you only need to make sure the listbox is bound to a table, so you can add, delete items to it.
you can't add multiple items to the listbox using combobox. you can only select 1 item in a combo.
 

moke123

AWF VIP
Local time
Yesterday, 23:13
Joined
Jan 11, 2013
Messages
3,910
There are a number of alternatives such as multi select listbox or picklists. Depends upon how many childasset items there are, how much available real estate, table set up, etc.
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 20:13
Joined
Oct 29, 2018
Messages
21,449
Hi. I wonder what is the purpose of the Listbox. Will the user use both the Combobox and Listbox? If so, why would you even need a Combobox?
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 20:13
Joined
Oct 29, 2018
Messages
21,449
@SparkieDEV If you would like to reply to a post, please click on the "Reply" button instead of the "Report" button. Thanks!
 

SparkieDEV

New member
Local time
Today, 04:13
Joined
Oct 13, 2020
Messages
26
Hi. I wonder what is the purpose of the Listbox. Will the user use both the Combobox and Listbox? If so, why would you even need a Combobox?
I am hoping to answer everyone's questions @moke123 @arnelgp in this reply: The database contains couple hundred assets of which several assets would be related to it. I have three types of forms, Audits, Incidents and Projects. I want to use this idea on the incident and projects forms. The user (me) will select an asset to open a form and within that form I would then select the childassets that are of concern to that incident or project. It is likely that multiple items would need to be selected to "identify" what childasset items that particular form/record is relating to. Thus, I am looking for a way to identify childasset items from a list and record them onto the form perhaps in a listbox.
 

Galaxiom

Super Moderator
Staff member
Local time
Today, 13:13
Joined
Jan 20, 2009
Messages
12,851
Sounds like it should be a many to many relationship and implemented as a subform.

The table relationships should always be worked out before considering the forms.
 

Users who are viewing this thread

Top Bottom