用这个事件:
http://www.foxtable.com/help/topics/0628.htm
如果是非逻辑列:
Dim dr as datarow = e.datarow
dim cnt as integer
cnt = iif(dr.isnull("a"),0,1) + iif(dr.isnull("b"),0,1) + iif(dr.isnull("c"),0,1)
if cnt <> 1 then
e.cancel = true
messagebox.show("错误")
end if
如果是逻辑列:
Dim dr as datarow = e.datarow
dim cnt as integer
cnt = iif(dr("a"),1,0) + iif(dr("b"),1,0) + iif(dr("c"),1,0)
if cnt <> 1 then
e.cancel = true
messagebox.show("错误")
end if