采用可通用下拉目录树,当我不同的表的对应的列名是不一样的,
比如
表1 tr("邮编") =
dr("邮编")
表2 tr("邮政编码") = dr("邮编")
如果做到通用?
错哪里了?
If Tables("窗口1_Table1").Current("外协") = True Then
Tables("窗口1_Table1").Cols("加工人").DropForm = "外协"
ElseIf Tables("窗口1_Table1").Current("外协") = False Then
Tables("窗口1_Table1").Cols("加工人").DropForm = "本公司"
End If
全错。prepareedit事件
if e.col.name = "加工人" then
if e.row("外协") then
e.col.DropForm = "外协"
else
e.col.DropForm = "本公司"
end if
end if
蓝老师,“外协”是逻辑列,下列代码中 = True 为什么可以省略?
If e.Row("外协") = True Then
先理解一下if的用法就明白了:
http://www.foxtable.com/webhelp/topics/0223.htm
单分支形式:
If 条件表达式 Then
代码
End If
如果条件表达式的计算结果为True,也就是条件成立的话,则执行代码。
例如在命令窗口输入下面的代码:
如果勾选了,那么e.Row("外协")的值就是true,符合条件【If true Then】。
【If e.Row("外协") = True Then】其实等于【If true = True Then】,也就是等于【If true Then】