>I'm trying to populate a combo box with an sql command (RowSourceType=3)
>
>Here is what i'm putting in the RowSource:
>
>Select functions.function from functions where type="S" into cursor ComboString
>
>the combo always comes up empty!
>
>any ideas?
>
>
>thanks in advance for your sage advice!
>
>scott
There are a couple of ways you can go here. The problem you are having is because you are right in the middle of the two.
First you can use a(n) SQL clause to populate your combo. To do so,
Set RowSourceType = 3 (SQL - Statement)
Set RowSource = "SELECT this FROM that WHERE something = someotherthing ORDER BY theotherthing INTO CURSOR mycursor"
You do need the INTO CURSOR mycursor or it will fail.
As Ed said, you can then use the Combo.Requery() method to refresh your combo if the parameter changes.
Second you can fire your sql into a cursor and set the row source type to 1 (Alias)
Set RowSourceType = 1 (Alias)
Set RowSource = "mycursor" (Assuming the same SQL as above)
In which case you can re-fire the SQL to generate your cursor again. You will have to do the bindings again ...
I recommend the former method as it has never failed, and is nice and quick.
Regards,
Jason
Jason Tryon
Senior Systems Analyst / Technical Lead
eBusiness / iPage