简体   繁体   中英

“ #Name? ” error in access using DLookup

在此处输入图片说明

What I am trying to do is to have a value("Element" which is a primary key) from my Elements table be inserted into the time textbox based on the result from the previous combox .

Is this the write snytax to achieve this ??

=DLookUp("[Time]","[Elements]","[Element]=" & [Forms]![1 Cut Wire and Cable Only]![Element])

I suspect that there is a mismatch between the name of your combo box control and name you use in your DLookup. Try changing the combo box control's Name to cbxElement and then using

=DLookUp("[Time]","[Elements]","[Element]=""" & [cbxElement] & """")

for the Control Source of the text box. Note that it is usually a good idea to use a prefix like "cbx" for combo boxes, "txt" for text boxes, etc., because

  1. it makes them easier to find in an IntelliSense list, and

  2. it avoids potential conflicts when the name of a control is identical to the name of a field in the underlying record source.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM