多谢!
回复 10楼 吹水佬
在form的activeate事件里加了如下语句BINDEVENT(thisform.grid1.column8.text1,'keypress',,'click')
只在第一次触发有效,触发事件():
PARAMETERS bin1,bin2,bin3,bin4
sele 1
USE data\ztml EXCLUSIVE
appe blank
replace id6 with recno(),dw WITH '件',th WITH lmca,rq WITH DATE()
thisform.grid1.RecordSource='ztml'
thisform.grid1.column1.ReadOnly = .T.
thisform.grid1.column9.ReadOnly = .T.
thisform.grid1.column10.ReadOnly = .T.
thisform.grid1.column8.text1.AutoComplete= 1
thisform.grid1.column8.text1.AutoCompTable= 'data\gyzxcomp'
thisform.grid1.column4.text1.AutoComplete= 1
thisform.grid1.column4.text1.AutoCompTable= 'data\ggcomp'
thisform.grid1.column3.text1.AutoComplete= 1
thisform.grid1.column3.text1.AutoCompTable= 'data\mccomp'
thisform.grid1.column1.header1.Caption='序号'
thisform.grid1.column2.header1.Caption='图号'
thisform.grid1.column3.header1.Caption='名称'
thisform.grid1.column4.header1.Caption='规格'
thisform.grid1.column5.header1.Caption='单位'
thisform.grid1.column6.header1.Caption='数量'
thisform.grid1.column7.header1.Caption='单重'
thisform.grid1.column8.header1.Caption='类别'
thisform.Refresh
thisform.grid1.setfocus
grid1的数据源是ztml,在column8.text1里回车后触发command2.click(),对表ztml增加一条空记录。测试时只有第一次回车触发增加新纪录,增加完再回车不触发click事件了,不知道哪里出错?
[此贴子已经被作者于2016-1-27 16:19编辑过]