Hi all,
It looks like a have an error on an expression for the property control source of a textbox, but I don't know what fails.
The expression is:
=IIf(IsNull(DLookUp("[ProductName]";"Menu";"[ProductID] =" & [txt1]));"";DLookUp("[ProductName]";"Menu";"[ProductID] =" & [txt1]) & ", ") & IIf(IsNull(DLookUp("[ProductName]";"Menu";"[ProductID] =" & [txt2]));"";DLookUp("[ProductName]";"Menu";"[ProductID] =" & [txt2]) & ", ") & IIf(IsNull(DLookUp("[ProductName]";"Menu";"[ProductID] =" & [txt3]));"";DLookUp("[ProductName]";"Menu";"[ProductID] =" & [txt3]) & ", ") & IIf(IsNull(DLookUp("[ProductName]";"Menu";"[ProductID] =" & [txt4]));"";DLookUp("[ProductName]";"Menu";"[ProductID] =" & [txt4]) & ", ") & IIf(IsNull(DLookUp("[ProductName]";"Menu";"[ProductID] =" & [txt5]));"";DLookUp("[ProductName]";"Menu";"[ProductID] =" & [txt5]) & ", ") & IIf(IsNull(DLookUp("[ProductName]";"Menu";"[ProductID] =" & [txt6]));"";DLookUp("[ProductName]";"Menu";"[ProductID] =" & [txt6]) & ", ") & IIf(IsNull(DLookUp("[ProductName]";"Menu";"[ProductID] =" & [txt7]));"";DLookUp("[ProductName]";"Menu";"[ProductID] =" & [txt7]))
If the values of Dlookup are ALL NOT null then there's no error, but if one of then is null, an error appears. Whats wrong with the if statement?
thanxs!
alej
It looks like a have an error on an expression for the property control source of a textbox, but I don't know what fails.
The expression is:
=IIf(IsNull(DLookUp("[ProductName]";"Menu";"[ProductID] =" & [txt1]));"";DLookUp("[ProductName]";"Menu";"[ProductID] =" & [txt1]) & ", ") & IIf(IsNull(DLookUp("[ProductName]";"Menu";"[ProductID] =" & [txt2]));"";DLookUp("[ProductName]";"Menu";"[ProductID] =" & [txt2]) & ", ") & IIf(IsNull(DLookUp("[ProductName]";"Menu";"[ProductID] =" & [txt3]));"";DLookUp("[ProductName]";"Menu";"[ProductID] =" & [txt3]) & ", ") & IIf(IsNull(DLookUp("[ProductName]";"Menu";"[ProductID] =" & [txt4]));"";DLookUp("[ProductName]";"Menu";"[ProductID] =" & [txt4]) & ", ") & IIf(IsNull(DLookUp("[ProductName]";"Menu";"[ProductID] =" & [txt5]));"";DLookUp("[ProductName]";"Menu";"[ProductID] =" & [txt5]) & ", ") & IIf(IsNull(DLookUp("[ProductName]";"Menu";"[ProductID] =" & [txt6]));"";DLookUp("[ProductName]";"Menu";"[ProductID] =" & [txt6]) & ", ") & IIf(IsNull(DLookUp("[ProductName]";"Menu";"[ProductID] =" & [txt7]));"";DLookUp("[ProductName]";"Menu";"[ProductID] =" & [txt7]))
If the values of Dlookup are ALL NOT null then there's no error, but if one of then is null, an error appears. Whats wrong with the if statement?
thanxs!
alej