2012-02-14 45 views
2

我有一個帶有文本框的Access窗體,該文本框用作表達式,因爲它是controlsource來計算要顯示的值。雖然下面的表達式在Access 2003中工作正常,但它不會自動顯示在Access 2007中。只有當我點擊該字段時,纔會顯示值。它是根據表單上的其他字段檢查數據庫中的值。如果其爲NULL,則該字段顯示「N/A」。如果它不是NULL,它將顯示在數據庫中找到的值。計算的文本框控件在Access 2007中未顯示值,但在2003年顯示

有誰知道我可能會做錯什麼?

=IIf 
(
    IsNull(DLookUp("SomeField","SomeTable","SomeField = Forms!frm_FormName!cboSomeCombobox")), 
    "N/A", 
    LookUp("SomeField","SomeTable","SomeField = Forms!frm_FormName!cboSomeCombobox") 
) 

回答

2

問題由2007年的Microsoft Office修復的Access 2007套件Service Pack 1

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. 

http://support.microsoft.com/kb/942378

+0

如果Access的版本是什麼SP2?我看到我正在運行Access 2007(12.0.6535.5005)SP2 MSO(12.0.65.62.5003)。這是否意味着此更新仍需要應用? – StoneJedi 2012-02-14 01:20:02

+0

本答案文章似乎表明它已修復Vista,但不是在Windows 7上... http://answers.microsoft.com/zh-cn/office/forum/office_2007-access/access-2007-on-vista -unboound-text-box-with/2f36277d-5499-4236-8e08-9fe3a752f375 – StoneJedi 2012-02-14 01:25:18

+1

嗨Remou,你送我走了正確的道路。 SP3實際上解決了Windows 7上的問題,所以現在我很好。謝謝! – StoneJedi 2012-02-15 19:47:33