Selection in the drop-down list corresponding to criterion (2) (1 Viewer)

Superpat

Member
Local time
Today, 16:16
Joined
Aug 15, 2020
Messages
96
Hello,
arnelgp made me a great code for, when I select a name in a list, On another list, the selection only gives me part of the corresponding list. (see code of t_SousCat).
I want to do the same thing with the t_CompleteNouveau form but I'm doing it wrong and I can't.
Could you redo this part of the code for me.
Thanks for your help.

Liste1.jpg
Liste2.jpg
 

Attachments

  • Essai_SousCat020.zip
    1.4 MB · Views: 90

Ranman256

Well-known member
Local time
Today, 10:16
Joined
Apr 9, 2015
Messages
4,337
no code is needed.
combo2's query looks at combo1

select field1 from table where [category]=forms!fMyForm!combo1

but you do need to refresh combo2 when the user picks combo1:

Code:
sub combo1_afterupdate()
  combo2.requery
end sub

OK, 1 line of code.
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 22:16
Joined
May 7, 2009
Messages
19,245
you need to create the query as advised on post#2.
i already made it (r_SousCat) and use it as the
rowsource of the lst_CategoriesSousCat listbox.
 

Attachments

  • Essai_SousCat020.zip
    1.4 MB · Views: 98

Superpat

Member
Local time
Today, 16:16
Joined
Aug 15, 2020
Messages
96
Thank you both very much for your invaluable help. (y)
I answer after a certain delay because I try to understand the process, even for a few lines of code I spend a lot of time.
I saw, among other things, that there was a query created, a modified text zone as well as the linked columns and the column widths.
On my own, I certainly couldn't have done this.
Your help allows me to move forward in my little project.
 

Users who are viewing this thread

Top Bottom