Ponzaro
Ponzaro

Reputation: 149

Error #Name? in access form with DLookup

I have the error #Name? in a form in Access 2013 in a textbox that have as origin a DlookUp function. Specifically I need to do the same thing that is on this topic: automatically update the field Costo Unitario field based on the selection of the field Operatore

enter image description here

The combobox of the Operatore field takes the values from a table named Operatori that it is like that:

Operatore        CostoOp_Unitario
---------        --------
Marco             20,07
Giuseppe          20,02
Gennaro           19,69
Pierangelo        17,05

The function that is set up as Control Source for the textbox that gives the #Name? error is:

=DLookUp([CostoOp_Unitario];[Operatori];"[Operatore]=""" & [OperatoreComboBox].[Text] & """")

based on the function that is present in the thread that I linked above. OperatoreComboBox is the combobox Operatore in the image. Why it outputs this error?

Upvotes: 0

Views: 1368

Answers (1)

mdialogo
mdialogo

Reputation: 473

I think your syntax is not correct. Try this one:

=DLookUp("[CostoOp_Unitario]","Operatori","[Operatore] = '" & [OperatoreComboBox] & "'")

Upvotes: 2

Related Questions