Solved How to create Multivalued on an Unbound Combo box (1 Viewer)

Sarah.M

Member
Local time
Today, 21:32
Joined
Oct 28, 2021
Messages
335
Hi, Plz note, My VBA is blocked by IT for security reason.
I can use only Expression builder, Macros, Queries, Tables, Forms and Reports only.
------------------------------------------------
1. I have Users unbound Combo Box if I click on it he will append that user/s name to another table, so how can I make this unbound Combo box to pick multi values (Multi Users)?
2. Also if I add for example Nancy twice I want to get message said "You can not add Nancy twice in Member table"?
3. I want also, If I click on Add new meeting Add Mode, I want the first member to be by default is the creator, but if it is in Edit mode do nothing

I succeed doing some of the things but others things I could not :(

I read this article, but this article for bound combo box and you need to do it from the table properties 😒

plz help me 🙏
Sample attached
1649233542820.png
 

Attachments

  • 12.accdb
    2.3 MB · Views: 207

June7

AWF VIP
Local time
Today, 10:32
Joined
Mar 9, 2014
Messages
5,466
1. an unbound combobox cannot be multi-select, must be bound to a field set up for multi-value input - an unbound listbox can be multi-select http://allenbrowne.com/ser-50.html

2. code in BeforeUpdate event to validate data, use DLookup()

3. would need a field in table that can be used to set a sort order or use VBA to build a ValueList as the combobox source
 

Ranman256

Well-known member
Local time
Today, 14:32
Joined
Apr 9, 2015
Messages
4,339
List boxes are multi select.
 

Sarah.M

Member
Local time
Today, 21:32
Joined
Oct 28, 2021
Messages
335
Thanks for all for your reply,

Is there any trick to do it? 🙏 I love Multivalued Combo box
 

isladogs

MVP / VIP
Local time
Today, 19:32
Joined
Jan 14, 2017
Messages
18,209
No it cannot be done with an unbound combobox.
It is absolutely impossible! This is why....

Multivalued combo boxes work by linking bound data in a table to another deep hidden attached system table.
That works though most experienced developers (including myself) will strongly recommend you do not use them.
However it is impossible to have an attached table if there is no bound data table to attach it to.

As already stated, listboxes can be made multiselect (simple or extended).
These work in a totally different way and are perfectly OK to use.
If you want to save space, you could even make the listbox a single row in height .... though it would be tricky to use
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 14:32
Joined
Feb 19, 2002
Messages
43,230
Unbound listboxes can be multi-select. You need a loop to collect the selected items.
 

isladogs

MVP / VIP
Local time
Today, 19:32
Joined
Jan 14, 2017
Messages
18,209
Unbound listboxes can be multi-select. You need a loop to collect the selected items.

Ah ... but doing that requires code and Sarah cannot use code as she clearly states in all her threads - see post #1
 

Pat Hartman

Super Moderator
Staff member
Local time
Today, 14:32
Joined
Feb 19, 2002
Messages
43,230
Ah ... but doing that requires code and Sarah cannot use code as she clearly states in all her threads - see post #1
Can't you create a read loop with a macro? MS says they can do anything:)
 

June7

AWF VIP
Local time
Today, 10:32
Joined
Mar 9, 2014
Messages
5,466
A macro loop can be built with If Then and InputBox. No idea how macro would address listbox ItemsSelected. Inclined to say it can't. Listbox ItemsSelected and Selected properties aren't even available in macro design.
 
Last edited:

Users who are viewing this thread

Top Bottom