新建一个窗口,功能是商品入库,确认入库的clicked里这样写:
if sle_1.text="" OR sle_2.text=""OR sle_3.text=""OR sle_4.text=""OR sle_5.text="" then
messagebox("警告","输入不能为空!")
return
else
c=trim(sle_1.text)
d=trim(sle_2.text)
e=trim(sle_3.text)
f=trim(sle_4.text)
g=trim(sle_5.text)
select innum
into :h
from purchase
where innum=:c;
if h<>"" then
messagebox("警告","此编号已存在!")
return
else
c=trim(sle_1.text)
d=trim(sle_2.text)
e=trim(sle_3.text)
f=trim(sle_4.text)
g=trim(sle_5.text)
select code
into :i
from stock
where code=:d ;
if i="" then
insert stock(code,qua)
values(:d,:e);
insert purchase (innum,code,qua,dat,per)
values(:c,:d,:e,:f,:g);
messagebox("信息提示","添加成功")
sle_1.setfocus();
return
else
select qua
into :j
from stock
where code=:d ;
int k,l;
k=integer(j);
l=integer(e);
k=k+l;
update stock
set qua=:k where code=:d ;
insert purchase (innum,code,qua,dat,per)
values(:c,:d,:e,:f,:g);
messagebox("信息提示","添加成功")
sle_1.setfocus();
end if
end if
end if
c,d,e,f,g,h,i 都是定义的字符型的,这些代码能运行,但是问题是,如果触发了条件2,再重新给sle_1输入个新值,那么结果还是提示 此编号已存在 ,也就是说c的值一直都是第一次输入的sle_1中的值,请问触发条件2后,重新在sle_1中输入新值,怎么才能跳到条件3里?求指教!
------解决方案--------------------