dim a1 as integer
dim b1 as integer
有10个 label ,值都是数字,名称分别为 label1--label10,
表A有10个逻辑列,名称分别为第一列--第十列,
而这10个列中,当前行有且只有2个值为TRUE.
需要按以下规律 给 a1 ,b1 赋值
比如
if Tables("表A").Current("第一列") = true '(列号为1 )' and Tables("表A").Current("第三列") = true '(列号为3)' then
if forms("窗口1").controls(label1).txt < forms("窗口1").controls(label3).txt then
a1=forms("窗口1").controls(label1).txt '取 值为true的当前行的2个列的列号对应的label的值,把较小的值给a1,较大的给a2.
b1=forms("窗口1").controls(label3).txt
else
b1=forms("窗口1").controls(label1).txt
a1=forms("窗口1").controls(label3).txt
end if
end if
考虑所有的情况,如何用简洁的代码写?谢谢、