I am trying to create a function that can return me the employee name given the employee ID on a shared table but error pops out:
"Runtime Error '3075': Syntax error in string in query expression '[Employee ID] = 'XXXXX' ".
I tried to implement the different answers I found online but I still couldn`t fix it. Below is my code in question.
Function getName() As String
Dim Name As String
getName = DLookup("[Employee Name]", "ID Table", "[Employee ID] = '" & getID & "'")
'getID is a function that returns a string and both Employee Name and Employee ID are in the ID Table
End Function