Hi.
I have set up some code to do a Dlookup. The code doesnt throw up an error, but it doesnt find the lookup. However, when you put the exact same code in a query and run it with the same example it works! Any ideas why this might be happening?
The code is as below:
stra = Nz(DLookup("[ID No]", "[P Import]", "[Name]='" & Me.[R Name] & "'"), "")
Me.[O Number] = stra
DoCmd.Requery
I have taken over this from someone else, and all the field names have spaces in, which i have avoided in my own designs... Is there something to do with this that might be affecting it?
I have set up some code to do a Dlookup. The code doesnt throw up an error, but it doesnt find the lookup. However, when you put the exact same code in a query and run it with the same example it works! Any ideas why this might be happening?
The code is as below:
stra = Nz(DLookup("[ID No]", "[P Import]", "[Name]='" & Me.[R Name] & "'"), "")
Me.[O Number] = stra
DoCmd.Requery
I have taken over this from someone else, and all the field names have spaces in, which i have avoided in my own designs... Is there something to do with this that might be affecting it?