我的方法:
在你的 确定 按钮代码下
先得到你 当前输入的 零配件名称-----
string cur_name
cur_name = trim(dw_1.getitemstring(dw_1.getrow(),"name"))
//trim()去掉多余空格!
string temp
select 列名 into :temp from 表名 where 列名=:cur_name
//下面其实用个SQLCACODE判断应该也可以,或者象楼上一样判断是否为 空!
if SQLCACODE = 1 then
messagebox("","重复!!!")
end if
也可以在DW的ITEMCHANGED 里写
integer rowi
string di
CHOOSE CASE dwo.name
CASE "cpxh"
select cpxh into :di from ljgdk where cpxh=:data;
if di='' then
else
messagebox("警告","该图号已有,不要重复输入",stopsign!)
end if
END CHOOSE