I am new to access and am trying to use a dlookup macro. I am trying to pull the field Unit Price from a table called Products Where am i going wrong with this code.
DLookUp("UnitPrice","Products","ProductID = " & [ProductID])
I am new to access and am trying to use a dlookup macro. I am trying to pull the field Unit Price from a table called Products Where am i going wrong with this code.
DLookUp("UnitPrice","Products","ProductID = " & [ProductID])
Are you referencing a control (text or combo box) on form to get ProductID criteria? Is this control bound?
If ProductID is a text field, need apostrophe delimiters. Does the field UnitPrice have a space as shown in your question or no space as shown in the DLookup?
DLookUp("UnitPrice","Products","ProductID = '" & Me.ProductID & "'")
DLookUp("[Unit Price]","Products","ProductID = '" & Me.ProductID & "'")
How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.