DLookup in MS Access help

I’m trying to use the Dlookup function to return one particular value in an Access report from a table.

I built a simple database to learn the syntax and I can’t get it to work.

There is one table, “Table1” that looks like:
City,State
Miami, FL
Dallas, TX

And now I have Report1 (based on the “Table1” Table). I placed a text box named City that is based on the same named field in Table1. I placed another text box with the Record Source as =DLookUp(“State”,“Table1”,[City]=[Reports]![Report1]![City])
in the detail field.

According to the Help files, that formula should return the corresponding State from table1 but it doesn’t. It only returns the first State, in my case FL.

I also tried: =DLookUp(“State”,“Table1”,"[City]= " & [Reports]![Report1]![City])
but that just gives me an #error.

What is wrong with the formula? :confused:

BTW, I actually have to use a dlookup to return a value from a table totally unrelated table (unlike my example).

ok forget it! I just figured it out.

The entire criteria needs to be text.