Search code examples
vbams-access

NA in textbox following DLOOKUP


I am using a dlookup to display some table content in a textbox but its returning #NA

For example: I have a table with 2 columns called USER1 & Total Calls Answered, and the table is called hourly1

My Dlookup is:

 =DLookUp("[Total Calls Answered]","[Hourly1]","[userid] = [USER1]")

Why is my textbox showing #NA


Solution

  • As soon as the table [Hourly1] has only two fields, it means that it has no field [CDP1]. If this is the name of control of your form, use this for numeric CDP1:

    =DLookUp("[Total Calls Answered]","[Hourly1]","[userid] = " & [CDP1])