假设要存入数据的表明为temp
在表单的init事件中
use temp
thisform.grid1.recordsource = 'temp'
然后确实你的输入顺序,否则的话在两个text控件的keypress事件中都加入相同的代码即可,代码结构如下
if nKeyCode = 13
select temp
go top
insert befor blank
repl 商品编号 with thisform.text2.value,数量 with thisform.text1.value
go top
thisform.grid1.refresh
endif
此处没有照顾细节问题,相关属性自行设定