运行看看,最右边是不是你要的数据?
[ 本帖最后由 TonyDeng 于 2012-3-17 22:55 编辑 ]
程序代码:
CLEAR ALL USE "经纱号数范围 品质指标" ALIAS tblTest EXCLUSIVE IN 0 goForm = NEWOBJECT("C_Form") goForm.Show READ EVENTS USE IN tblTest RETURN DEFINE CLASS C_Form AS Form Caption = "经纱品质" WindowState = 2 ADD OBJECT Grid1 AS Grid PROCEDURE Activate WITH ThisForm.Grid1 .Top = 0 .Left = 0 .Height = ThisForm.Height .Width = ThisForm.Width ENDWITH ENDPROC PROCEDURE Destroy CLEAR EVENTS ENDPROC PROCEDURE Grid1.Init WITH This .RecordSourceType = 1 .RecordSource = "tblTest" .ColumnCount = FCOUNT("tblTest") + 1 WITH .Columns(.ColumnCount) .Header1.Caption = "实际品质" .Header1.Alignment = 2 .ControlSource = "IIF(InScope(), tblTest.经纱品质指, '')" ENDWITH ENDWITH ENDPROC ENDDEFINE FUNCTION InScope() AS Logical RETURN (tblTest.经纱品质指 >= tblTest.经纱特数下) .AND. (tblTest.经纱品质指 <= tblTest.经纱特数上) ENDFUNC
[ 本帖最后由 TonyDeng 于 2012-3-17 22:55 编辑 ]
授人以渔,不授人以鱼。