grid显示问题
表单中有一组合框、一表格、一命令按钮
组合框init代码:
select 科目名 from ykms into cursor lkms order by 科目号
thisform.combo1.RowSourceType=3
thisform.combo1.RowSource='select 科目名 from ykms into cursor lkms order by 科目号'
命令按钮init代码:
select * from ykms1 where 余额<>0 into table zkms order by 科目号
thisform.grid1.recordsource='zkms.科目名,科目号,方向,余额' &&科目余额
go top
thisform.grid1.refresh
endif
出错语句
thisform.grid1.recordsource='zkms.科目名,科目号,方向,余额'
现象:表格仅显示字段名,无字段内容,表格左侧出现一列黑线,(类似删除标志)
我错在什么地方?请高手指教,我的水平尚低,请多关照。谢谢
[解决办法]
命令按钮init代码:
select 科目名,科目号,方向,余额 from ykms1 where 余额<>0 into table zkms order by 科目号with thisform.grid1 .columncount=fcount("zkms") .recordsource="zkms" .recordsourcetype=1 for i=1 to fcount("zkms") .columns(i).header1.caption=field(i) endfor go top .refresh endwith