Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DBlookupcombox to display only selected values? 1

Status
Not open for further replies.

pierrotsc

Programmer
Nov 25, 2007
358
US
I am using Absolute database and I have 2 dblookupcombobox.
When i select a value in the first combobox, I want it to affect the drop down list of the second. For example, if i pick itemindex =1 in the first combobox, i want only to show itemindex 1 and 3 in the second combobox and not 2.
Is that possible?

Thanks.
P
 
Very possible, but highly depends on how you are populating the data in these. You will probably need to dynamically change the SQL statement in the second combo box upon the first one changing. This SQL statement shall include any necessary code to filter based on the selection in the first one. For example...

Code:
select ID, Caption from Colors where CType = 123

where CType represents some 3rd field in this table which resembles the listing in the first box, and 123 is the ID of the record selected in the first. Presumably, the 1st and 3rd items in this 2nd combo should have CType = 123 and the 2nd item is NOT 123 (in order to match your scenario).

There are of course many ways to do this, but without seeing the exact scenario, all I can do is give examples, I can't give a specific answer which fits your project.

JD Solutions
 
Ok...that is kind of tough for me to understand but i am going to try to learn something new. Right now I only use the component property.
I assume that i should put an sql statement in both onchange statement.
I never used fliter. I do see a filter property under the dataset but I guess it is different.
Right now, the list inside the combobox are pulled from a table. So it is possible to alter the pulling of the data from the table and only show the record you want?
Do you know any web site where I could see some infos about that?
Thanks.
P
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top