Solved Set the value of SelectBox (1 Viewer)

yamus

Member
Local time
Today, 21:36
Joined
Aug 12, 2020
Messages
81
Hi
I have 3 listBoxes
TypeBox, ManufBox and ModelBox
I want to set the ModelBox values based on the values of TypeBox and ManufBox
Example:
TypeBox : Printer
ManufBox: LexMark
based on the two listBoxes above, ManufBox will show values that correspond to all the models of Lexmark printers
By the way, my database contain the three tables: Type, Manufacturer and Model
IdType and idManuF are foreign keys in the Model table
PS: i have tried to set the row source of ModelBox based on the queries that select from Type and Manufacturer but it only worked the first time. After that, the values of ModelBox do not change
Example:
If i choose "Computer" and "DELL" as Type and Manufacturer respectively, the ModelBox displays all the Dell Computet models without problem. But if i change the type to "printer" Manufacturer to "HP", the ModelBox still displays DELL computer modles instead of HP printer models
Any help please
 

Isaac

Lifelong Learner
Local time
Today, 13:36
Joined
Mar 14, 2017
Messages
8,777
Hi
I have 3 listBoxes
TypeBox, ManufBox and ModelBox
I want to set the ModelBox values based on the values of TypeBox and ManufBox
Example:
TypeBox : Printer
ManufBox: LexMark
based on the two listBoxes above, ManufBox will show values that correspond to all the models of Lexmark printers
By the way, my database contain the three tables: Type, Manufacturer and Model
IdType and idManuF are foreign keys in the Model table
PS: i have tried to set the row source of ModelBox based on the queries that select from Type and Manufacturer but it only worked the first time. After that, the values of ModelBox do not change
Example:
If i choose "Computer" and "DELL" as Type and Manufacturer respectively, the ModelBox displays all the Dell Computet models without problem. But if i change the type to "printer" Manufacturer to "HP", the ModelBox still displays DELL computer modles instead of HP printer models
Any help please
If you don't post the code you're using to do the cascading updated rowsources, how can we try to answer your question about why the code isn't working?
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 04:36
Joined
May 7, 2009
Messages
19,242
1. Requery Manufbox and Modelbox on AfterUpdate event of Typebox.
2. Requery Modelbox on Manufbox AfterUpdate event.
 

Galaxiom

Super Moderator
Staff member
Local time
Tomorrow, 06:36
Joined
Jan 20, 2009
Messages
12,852
Example:
TypeBox : Printer
ManufBox: LexMark
based on the two listBoxes above, ManufBox will show values that correspond to all the models of Lexmark printers
By the way, my database contain the three tables: Type, Manufacturer and Model
IdType and idManuF are foreign keys in the Model table

That could be a normalisation issue since it is possible to put a model in the table that is not available for a Manufacturer.
You should be storing only a DeviceId in the main table with the information about devices in a related table.
 

yamus

Member
Local time
Today, 21:36
Joined
Aug 12, 2020
Messages
81
1. Requery Manufbox and Modelbox on AfterUpdate event of Typebox.
2. Requery Modelbox on Manufbox AfterUpdate event.
Thanks. That is exactly what i needed
I made the modelBox requery on TypeBox and ManufBox after update
Thanks again
 

Users who are viewing this thread

Top Bottom