Combo box, criteria selection (1 Viewer)

Superpat

Member
Local time
Today, 15:53
Joined
Aug 15, 2020
Messages
96
Hello,
I hope that during a click on the combo box "Conseiller", only those concerning the name in "Dénomination" be selected.
2022-08-16_150235.jpg

2022-08-16_152001.jpg


The content of Conseiller :
Code:
SELECT t_BANQUE.ID_BanquePK, [Nom] & " " & [Prenom] AS NomPrenom, t_BANQUE.Denomination
FROM t_BANQUE RIGHT JOIN t_Conseiller ON t_BANQUE.[ID_BanquePK] = t_Conseiller.BanqueFK;
Thank to help
 

Attachments

  • essai3.accdb
    960 KB · Views: 59

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Today, 08:53
Joined
Feb 28, 2001
Messages
27,186
Add a WHERE clause to the combo box's .RowSource to limit what is shown. I don't open databases that often, so I don't know the names of things. But the idea (with you substituting correct names) would resemble

Code:
SELECT t_BANQUE.ID_BanquePK, ....FROM ...  WHERE NomPrenom = Me.Denomination ;

I.e. tie your Denomination column on the main form to the Denomination column of the combo box.
 

Superpat

Member
Local time
Today, 15:53
Joined
Aug 15, 2020
Messages
96
@The_Doc_Man
Thanks to answer, that don't do at all.
I try this, and I clic on the ID 2, it's ok, but after, if I click on another, the fields does not update, see below (1 with 2) :

2022-08-16_163554.jpg




2022-08-16_160707.jpg


Code:
SELECT t_BANQUE.ID_BanquePK, [Nom] & " " & [Prenom] AS NomPrenom, t_BANQUE.Denomination
FROM t_BANQUE RIGHT JOIN t_Conseiller ON t_BANQUE.[ID_BanquePK] = t_Conseiller.BanqueFK
WHERE (((t_BANQUE.ID_BanquePK)=[ID_BanqueFK]));
 

Attachments

  • 2022-08-16_163409.jpg
    2022-08-16_163409.jpg
    30 KB · Views: 40
  • essai4.accdb
    960 KB · Views: 55

bastanu

AWF VIP
Local time
Today, 06:53
Joined
Apr 13, 2010
Messages
1,402
Please have a look at the attached updated file, should do what you want. While you are actively selecting a contact in the combo the rest of the records with a different denomination will look blank but they'll get reset when you exit the control. Another alternative is to us a hidden text box to do the actual selection, there are many examples of that in this forum.
 

Attachments

  • essai4.accdb
    960 KB · Views: 73

Superpat

Member
Local time
Today, 15:53
Joined
Aug 15, 2020
Messages
96
Please have a look at the attached updated file, should do what you want. While you are actively selecting a contact in the combo the rest of the records with a different denomination will look blank but they'll get reset when you exit the control. Another alternative is to us a hidden text box to do the actual selection, there are many examples of that in this forum.
Thank you very much for your help and advice, I had no idea how to do it.
 

bastanu

AWF VIP
Local time
Today, 06:53
Joined
Apr 13, 2010
Messages
1,402
You're very welcome, good luck with your project!
:)
 

Users who are viewing this thread

Top Bottom