


Hi,
i was trying to bind data from a table's field o combo box .ut it shows an error
" Illegal Nested Blk Statement reference to table cus_sup_mstr"
I am attaching the code and error with this .pls help me out in this
Thanks,
Reena


Try this:
Define Variable csu like cus_sup_uschr[1] View-As Combo-Box.
Define Variable csi like cus_sup_inactive Initial "Yes" View-As Combo-Box List-Items "yes","no".
Define Variable fname as Char.
Define Variable outputfname as char.
FUNCTION fillCombo RETURNS CHARACTER () FORWARD.
Define Frame Frame1
Skip(2) csu Label "Payment Type" Colon 22 Space(2) csi Label "Inactive" Skip(3)
fname label "Output To" Colon 22 Skip(1) With Side-Labels Centered Three-D.
csu:LIST-ITEMS = "".
csu:LIST-ITEMS = fillCombo().
Prompt-For csu
csi
fname
with frame Frame1 side-labels.
If index(fname,".")= 0 then
Do:
fname = fname + ".csv".
END.
Assign outputfname = Input fname.
Output to value(outputfname).
/* Repeat: This creates an endless loop */
For Each cus_sup_mstr where cus_sup_uschr[1]=INPUT csu and
cus_sup_inactive=INPUT csi NO-LOCK:
/* Within a for each a record is always available, so this test will always give available */
If Not Available cus_sup_mstr then
Message("No Record Found!!!!").
Else
*/
Export Delimiter "" cus_sup_reqno column-label "Requisition Number"
cus_sup_addr column-label "Supplier Address"
cus_sup_name column-label "Supplier Name"
cus_sup_city column-label "City"
cus_sup_state column-label "State"
cus_sup_zip column-label "Zip"
cus_sup_adry column-label "Country"
cus_sup_type column-label "Supplier Type"
cus_sup_vatable column-label "Vatable"
cus_sup_taxable column-label "Taxable"
cus_sup_inactive column-label "Inactive" .
End.
/* end */
Output close.
FUNCTION fillCombo RETURNS CHARACTER
():
DEFINE VARIABLE cListItems AS CHARACTER NO-UNDO.
For each cus_sup_mstr No-Lock:
cListItems = cListItems + "," + (cus_sup_uschr[1]).
End.
RETURN SUBSTRING(cListItems,2).
END FUNCTION.