Hmmm, I've sussed it after searching around with different search
strings, but still get the feeling there is (or maybe should be?) and
easier way to do it.
I put this in the on value change of the part number selector:
filtervalue
=hk_thisform.get_pyvisible("supplier_combo").listcolumn().asstring()
#then set the filterstring - columname means the column of table your grid
filterstring ="supplier_number= '" + filtervalue + "'"
hk_thisform.datasource().disable()
hk_thisform.datasource().set_temporaryfilter(filterstring)
hk_thisform.datasource().set_use_temporaryfilter(True)
hk_thisform.datasource().enable()
IF you set-up the supplier first, each time you choose a new stock code,
the correct order code comes up.
It's what I was trying to put in my filterbox hen you press the ...
button, but a little more involved. I'm sure there's a good reason why
you can't do it the way that seemed obvious to me! ;-)
Robert Wood wrote:
> Hi all,
>
> I have two comboboxes: one picks a part number and he other one brings
> up an ordercode which is dependent on that part number originally
> selected. So, for example, I could pick an HCPL-0600 in the part number
> combo which then automatically in the second combo *only* brings up the
> possible order codes for that part number. In this case, both RS and
> Farnell might stock exactly the same part, but have completely different
> order codes. This is easy to do and works fine. *However*, what I'd like
> to do is use a *third* (supplier) combobox to filter out the order
> code(s) so that only the ordercodes for that particular supplier are in
> the combobox.
>
> I can put the following in the filter field of the ordercode combobox:
>
> supplier_number=6
>
> In my case, supplier number 6 is Farnell and that works a treat in that
> when I go to HCPL-0600 in my part number combobox, the only option in
> the ordercode combo is the Farnell order code.
>
> What I would like to do is something like this:
>
> supplier_number= suppliercombo.supplier_id
>
> supplier_id for Farnell, as I said, is 6 and that is chosen as the
> listcolumn in the suppliercombo combobox.
>
> Now, the above doesn't work and I've tried a few different ways of doing
> the syntax. Is there a simple way to do this by just sticking something
> in the filter field when you click on the ... button for the order code
> combobox? Or do I have to write some Python? I have looked through the
> archives and Jesus seems to have posted something similar to what I'm
> trying to do and he has written python.
>
> Many thanks,
>
> Rob
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Hk-classes-discuss mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/hk-classes-discuss
>
>
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Hk-classes-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hk-classes-discuss