>SET EXCLUSIVE OFF >SET DEFAULT TO ("C:\Foxpro Projects\Statistics") > >with thisform.combo1 > .RowSourcetype = 3 > .Rowsource = 'Select distinct type from products into cursor crsproduct' > .ColumnCount = 1 > .displayvalue='Select Product Group' >ENDWITH > >with this.combo2 > .RowSourcetype = 3 > .Rowsource = 'Select subtype from products where type=crsproduct.type into cursor crssubtype' > .ColumnCount = 1 > .displayvalue='Select Product Type' >ENDWITH >>
>Type Subtype > >Trouser Slimleg >Trouser Kickflare >Trouser Bootleg >Jacket Double Breasted >Jacket Single Breasted >I don't see something that'd cause error there, must be something else. Note that in below code combo1, combo2 codes are exactly same as yours :
Public oForm oForm = Createobject('myForm') oForm.Show Define Class myForm As Form Add Object combo1 As ComboBox With ; Height = 24, Left = 17, Top = 27, Width = 131 Add Object combo2 As ComboBox With ; Height = 24, Left = 161, Top = 27, Width = 131 Add Object label1 As Label With ; Caption = "Type", Height = 17, Left = 17, Top = 10, Width = 40 Add Object label2 As Label With ; Caption = "SubType", Height = 17, Left = 163, Top = 10, Width = 51 Procedure Load TEXT to m.MyText noshow Trouser Slimleg Trouser Kickflare Trouser Bootleg Jacket Double Breasted Jacket Single Breasted ENDTEXT lcTemp = Sys(2015)+'.txt' Strtofile(m.MyText,m.lcTemp) lnTypeLen = Len('Trouser ') Create Cursor Products (Type c(m.lnTypeLen),SubType c(30)) Append From (m.lcTemp) Type Sdf Erase (m.lcTemp) Endproc Procedure Init With This.combo1 .RowSourceType = 3 .RowSource = 'Select distinct type from products into cursor crsproduct' .ColumnCount = 1 .DisplayValue='Select Product Group' Endwith With This.combo2 .RowSourceType = 3 .RowSource = 'Select subtype from products where type=crsproduct.type into cursor crssubtype' .ColumnCount = 1 .DisplayValue='Select Product Type' Endwith Endproc Procedure combo1.InteractiveChange With This.Parent.combo2 .Requery() .ListIndex=0 .DisplayValue = 'Select Product Type' Endwith Endproc EnddefineCetin