Two multiple combo boxes values depend on each other (1 Viewer)

AsMok

IT IS ME ^_^
Local time
Today, 05:34
Joined
Sep 4, 2019
Messages
64
Hi all
it is long time since my last log in
nice new ACCESSWORLD view ...i like it:)
-----

my question is ....I have two multiple combo boxes

the first is for people who we invite for specific meeting (not all attend sometimes)

the second is for people who actually attend the meeting later

i have a table for "lets say" 100 names
for the first combo box (gusts) it is ok to choose from this 100 names table because no rule set which will be invited...

but the second combo box (attendance) will be be restricted to the choices from the first combo box

how can i do make attendance combo box values depends on the gusts ones on each record????
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 08:34
Joined
May 21, 2018
Messages
8,527
Not totally clear. Search this thread for the term cascading comboboxes. But I am not sure that is what you are asking. I read this that you want a multi select listbox where you can select everyone to invite. This populates listbox 2 where you can select those that attended. I have code to do that, but not sure once you select the attended where you save the information.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 08:34
Joined
May 21, 2018
Messages
8,527
If the cascading combobox is not what you want, come back and describe it better so we can help.
 

AsMok

IT IS ME ^_^
Local time
Today, 05:34
Joined
Sep 4, 2019
Messages
64
If the cascading combobox is not what you want, come back and describe it better so we can help.


HI
honestly i did not have time to try
and now I have another point regarding compo box
so i am preparing a mock db to share that makes the issue clearer

thanks in advance
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 08:34
Joined
May 21, 2018
Messages
8,527
That would help
 

AsMok

IT IS ME ^_^
Local time
Today, 05:34
Joined
Sep 4, 2019
Messages
64
Addition::

I solved my first question by a query that makes the names that appear in the gusts and attendances compo boxes only for the group members.......you can find that in the attached db....

NOW?

how can i add "select all" choice to my multiple compo box choices? sometimes all members are invited other times only some ones......

BTW I am a new user of access and do not know a lot about coding and programming ^_^

a cannot upload it it keeps giving me this message --The uploaded file does not have an allowed extension. -- i tried to upload an access file and a .rar file
 

vba_php

Forum Troll
Local time
Today, 07:34
Joined
Oct 6, 2019
Messages
2,880
i tried to upload an access file and a .rar file
if I'm not mistaken, both MDBs and ACCDB files are allowed here. I don't think RARs are, but I know that ZIPs are. don't you have WINZIP? It comes pre-installed with all windows OSs I think.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 08:34
Joined
May 21, 2018
Messages
8,527
Code:
Private Sub CmdSelect_Click()
 SelectUnselect
End Sub


Private Sub cmdUnSelect_Click()
 SelectUnselect False
End Sub
Private Sub SelectUnselect(Optional SelectAll As Boolean = True)
  'False to unselect
  Dim lstItem As Integer
  Dim lst As Access.ListBox
  Set lst = Me.ListMulti
  For lstItem = lst.ListCount - 1 To 0 Step -1
    lst.Selected(lstItem) = SelectAll
  Next lstItem
End Sub
 

zeroaccess

Active member
Local time
Today, 07:34
Joined
Jan 30, 2020
Messages
671
if I'm not mistaken, both MDBs and ACCDB files are allowed here. I don't think RARs are, but I know that ZIPs are. don't you have WINZIP? It comes pre-installed with all windows OSs I think.
Not exactly WinZip, but the functionality is built-in these days: select from the right-click context menu "Send to -> Compressed (zipped) folder"
 

zeroaccess

Active member
Local time
Today, 07:34
Joined
Jan 30, 2020
Messages
671
Hi all
it is long time since my last log in
nice new ACCESSWORLD view ...i like it:)
-----

my question is ....I have two multiple combo boxes

the first is for people who we invite for specific meeting (not all attend sometimes)

the second is for people who actually attend the meeting later

i have a table for "lets say" 100 names
for the first combo box (gusts) it is ok to choose from this 100 names table because no rule set which will be invited...

but the second combo box (attendance) will be be restricted to the choices from the first combo box

how can i do make attendance combo box values depends on the gusts ones on each record????
It also depends on whether you are trying to do this on a form's detail area or in a subform. If in a subform, it gets complicated.
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 08:34
Joined
May 21, 2018
Messages
8,527
Demo
 

Attachments

  • SelectAll.zip
    157.3 KB · Views: 62

AsMok

IT IS ME ^_^
Local time
Today, 05:34
Joined
Sep 4, 2019
Messages
64
I want to add select all to gusts and attendance fields
 

Attachments

  • 0.zip
    101.3 KB · Views: 77

AsMok

IT IS ME ^_^
Local time
Today, 05:34
Joined
Sep 4, 2019
Messages
64
Picture2.jpg
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 08:34
Joined
May 21, 2018
Messages
8,527
Noone is going to bite on this one. That is a multivalued field. These are very unpopular, and what you are asking cannot be done. People will recommend that you get rid of the multivalue field.
 

AsMok

IT IS ME ^_^
Local time
Today, 05:34
Joined
Sep 4, 2019
Messages
64
the following code from this site is working great for selecting all values if my row source is a table.... what should i change to change it to a query...

-----

Dim v As Variant
Dim vValueList As Variant
Dim rstAdd As DAO.Recordset
Dim rstLookupValues As DAO.Recordset

vValueList = Split(Me.FavColors.RowSource, ";")

' delete any possbile selected records...
Set rstAdd = Me.Recordset!MyColors.Value
Do While rstAdd.EOF = False
rstAdd.Delete
rstAdd.MoveNext
Loop

' now add all
Me.Recordset.Edit
Set rstAdd = Me.Recordset!MyColors.Value
Set rstLookupValues = CurrentDb.OpenRecordset("tblColors")
Do While rstLookupValues.EOF = False
rstAdd.AddNew
rstAdd(0) = rstLookupValues!ID
rstAdd.Update
rstLookupValues.MoveNext
Loop
Me.Recordset.Update

rstLookupValues.Close
 

MajP

You've got your good things, and you've got mine.
Local time
Today, 08:34
Joined
May 21, 2018
Messages
8,527
Hopefully someone will help, but it is unlikely. Most people are against using MVF and I am not going to help some one because it will just cause bigger problems. I use my own custom class, but works on true normalized databases.
Fake MVF.png
 

AsMok

IT IS ME ^_^
Local time
Today, 05:34
Joined
Sep 4, 2019
Messages
64

Hi many thanks :)

I used your code.....
  1. i just changed my control type to list box instead of combo box on the form and kept the table field a combo box ......
  2. and replaced my control name in your code ^_^

then it works as you can see

Any suggestions not to face any future problem????
Picture1.png
 

Attachments

  • 0.zip
    160.8 KB · Views: 78
Last edited:

Users who are viewing this thread

Top Bottom