Drop Combo dependent on another drop combo 
Author Message
 Drop Combo dependent on another drop combo

Does anybody know how to make the contents of one combo depend on the
contents of ANOTHER combo? Imagine two combos, one for Brands, one for
Products. The user selects the brand first, and then the product. The
Product combo should only show the children of the selected brand, *NOT*
all the products on file. (The common key in the relationship is the 'Code'.

I've tried the following code at several embed points, but can't quite get it right.

Relate:Product.Open()
Set(Product)

Loop until EOF(Product)
  Next(Product)
  If Error() Then Stop(Error()).

    If QBR:Code = PRO:Code then        ! QBR- Brand queue & PRO- Product file
       QPR:Description = PRO:Description  !QPR- Product queue
    End
    Add(QPR:Description)
End

Sort(Queue:Product,+QPR:Description)

Any suggestions are much appreciated!



Wed, 12 May 2004 18:43:48 GMT  
 Drop Combo dependent on another drop combo
I'm working on a project right now where I'm using a similar technique. You
didn't mention which version of Clarion you're using, so my answer may or
may not help. This is with C55PE release F. I was able to make this work
with no hand coding at all.
I found the "File Drop" control didn't work as you'd like it to, but the
"file drop combo" does. In the second (dependent) drop combo, the file
schematic is set to display the file using a key whose 1st field will be
used by the range limit value. In the dependent drop combo, set the range
limit field to the key field, set the range limit type to single value, and
set the range limit boundary value to the value provided by the first drop
combo. In my app, whenever I change the value in the 1st drop combo, the
second is automatically updated.
Hope this helps,
Adam Brayshaw
Clearsoft Computer Consulting


Quote:
> Does anybody know how to make the contents of one combo depend on the
> contents of ANOTHER combo? Imagine two combos, one for Brands, one for
> Products. The user selects the brand first, and then the product. The
> Product combo should only show the children of the selected brand, *NOT*
> all the products on file. (The common key in the relationship is the
'Code'.

> I've tried the following code at several embed points, but can't quite get
it right.

> Relate:Product.Open()
> Set(Product)

> Loop until EOF(Product)
>   Next(Product)
>   If Error() Then Stop(Error()).

>     If QBR:Code = PRO:Code then        ! QBR- Brand queue & PRO- Product
file
>        QPR:Description = PRO:Description  !QPR- Product queue
>     End
>     Add(QPR:Description)
> End

> Sort(Queue:Product,+QPR:Description)

> Any suggestions are much appreciated!



Sun, 16 May 2004 08:13:43 GMT  
 Drop Combo dependent on another drop combo
Hi

Im Using Clarion 5.5 path "F".

I have a couple of window using something like that. A FileDrop
Depending on another FileDrop.

I just Put an expresion on the record Filter of the FileDrop.
The record Filter is in the list properties in the first tab of
Actions.
Don't forget to put the field in Hot Fields.

I need to put a source in the fisrt FileDrop in the code New Selection
Before Generated Code (Priority 5000) like This:

If you are Using TPS Files Then Write :::
--------------------------------------
Clear(LOC:Partida)              ! This is the variable local of the
second FD
ThisWindow.Reset(True)          ! Refrhesh the Window

If You are Using SQL Then Write :::
-------------------------------
Clear(LOC:Partida)              ! This is the variable local of the
second FD
Flush(FDB7::View:FileDrop)      ! The VIEW of the second FD [ Only in
SQL ]
ThisWindow.Reset(True)          ! Refrhesh the Window



Sun, 16 May 2004 23:29:41 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Drop combo related to another drop combo

2. Drop Combo to Auto Drop

3. Drop Down Combo Box Issue?

4. File Drop Combo with ODBC file

5. File Drop Combo Filter Problems

6. Remove duplicates entries not working on file drop combo box

7. Drop combo - restore to blank condition

8. Select from File Drop Combo Box ?

9. File Drop Combo

10. Using Alias with Drop Down Combo

11. Drop Combo Problem

12. Dynamically Filtering a Drop Down Combo

 

 
Powered by phpBB® Forum Software