I have a field where i want to put a value from a DLOOKUP. The value is from tabel "Defaultdata" and i want to get the value from field "Value1". The criteria field in the tabel is "DefaultYear" and should be equel to a field in the current form named "Year". The "Year" field is a textformat field. My DLOOKUP looks like this : =DLookUp("Value1";"Defaultdata";"DefaultYear=""" & [Year] & """"). But it do not work as intended :-)
Kevin Robertson
@Reply 3 years ago
Year is a reserved word and shouldn't be used as a field or control name.
Access Reserved Words
Also, use commas in your DLookup function, not semi-colons.
Kim MittetOP
@Reply 3 years ago
Sorry, should have used the correct name which is "BudgetYear"
I used the Expressionbuilder which uses the semi-colon
Kevin Robertson
@Reply 3 years ago
Is there a reason 'BudgetYear' is a Text field and not a Number?
You say it doesn't work as intended - can you elaborate?
Kim MittetOP
@Reply 3 years ago
The errormessage is : "The entered expression contains nonvalid syntax - There is missing a operand or operator , you may have entered a nonvalid character, a comma instead of a semicolon, a semicolon instaed of a comma, or maybe you have enter'd text without without putting quotes around the text"
The errormessage is translated from another language - i hope it is understandable
Kim MittetOP
@Reply 3 years ago
Can anyone explain why i get an error in the field for this DLookUp. I get no error when i save the expression, but when i display the form, the field with the DLookUp as control source only display : #Error
If you are a Visitor, go ahead and post your reply as a
new comment, and we'll move it here for you
once it's approved. Be sure to use the same name and email address.
This thread is now CLOSED. If you wish to comment, start a NEW discussion in
Access Expert 10.