我有一个带有文本框的 Access 表单,该文本框用作表达式,因为它是计算要显示的值的控制源。虽然下面的表达式在 Access 2003 中运行良好,但它不会自动显示在 Access 2007 中。仅当我单击该字段时,才会显示该值。它的作用是根据表单上的其他字段检查数据库中的值。如果为 NULL,则该字段显示“N/A”。如果不为 NULL,则显示在数据库中找到的值。
有人知道我可能做错了什么吗?
=IIf
(
IsNull( DLookUp("SomeField","SomeTable","SomeField = Forms!frm_FormName!cboSomeCombobox")),
"N/A",
LookUp("SomeField","SomeTable","SomeField = Forms!frm_FormName!cboSomeCombobox")
)
最佳答案
2007 Microsoft Office 套件 Service Pack 1 在 Access 2007 中修复的问题
On a Windows Vista-based computer, fields that are bound to time-intensive
expressions are blank in Access 2007
Fields that are bound to time-intensive expressions are blank in Access 2007.
These fields are empty until you click the text box or until you click anything
outside of Access 2007 if the following conditions are true:
The Control Source property of a text box uses the DLookup() function.
The query that is called by the DLookup() function references a control on
a form.
关于ms-access - 计算的文本框控件在 Access 2007 中不显示值,但在 2003 中显示,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9270168/