DEV Community

Oscar Sun(孫守真字任真)
Oscar Sun(孫守真字任真)

Posted on

Answer: Search a string from inbutbox in a different table with dlookup and return the value to a MsgBox

How about this?

You have an extra opening bracket, Both!

X = (DLookup("Column B", "Names", "Column A =" & sr) ⇒

X = DLookup("Column B", "Names", "Column A =""" & sr & """")

or use StrComp function:

X = DLookup("Column B", "Names", "strcomp(Column A,""" & sr & """)=0")

ps…

Top comments (0)