0

摘要:我想在从组合框中选择特定值时显示以另一种形式存储的值(在文本框中)。我想将我拥有的两个组合框值传递给 DLoopup 属性,但每次我这样做都会给我一个错误。

下面是在文本框的控件源属性中插入的代码:

=DLookUp("[Year_ended]","1_Supportive_Housing","[BudgetYear] ='" & [Combo5] & "'")

这在文本框中给了我一个“#Error”。

还尝试了以下但给了我“#NAME”错误:

=DLookUp("[Year_ended]","1_Supportive_Housing","[BudgetYear] = '" & [Combo5.Value] & " And [Program_Name] = '" & [Combo7.Value] & "'")
4

1 回答 1

0

您需要整理好分隔符。AFAIR 预算年度是一个数字:

 =DLookUp("[Year_ended]","1_Supportive_Housing","[BudgetYear] =" & [Combo5])

将值传递给数字类型字段时,不要使用分隔符,对于文本,请使用引号,“Abc”或“Abc”,对于日期,请使用井号 (#) #2012/11/31#。

 =DLookUp("[Year_ended]","1_Supportive_Housing","[BudgetYear] =" & [Combo5]  & " And [Program_Name] = '" & [Combo7.Value] & "'")
于 2012-06-15T18:10:44.380 回答