QUOTE (LPurvis @ Mar 9 2010, 03:47 AM)
Sorry, I know this isn't current now, but since this thread was linked to I thought I'd mention something.
I absolutely agree that changing the name (ideally both the textbox control and any field to which it's bound) is vital. Working on with that is just giving you potential problems for no reason or gain. Changed as you have and all's well.
Just thought I'd mention that Access isn't totally clueless here about your intent.
It sees [Name] and resolves that property.
If the field or control were called something else (i.e. txtName ;-) then that property exists independently. Access has created that property for the field/control.
But with [Name] you're out of luck - that fundamental property already exists. It's resolved.
You're getting the name of the Form returned - not a field value. It's quite likely that you don't want to perform the DLookup based on the form name (though entirely possible).
As with many cases though - what allows you to tell Access what you what is disambiguation.
=DLookUp("[ID]","[Temp4]","[Name]='" & Form.[Name] & "'")
gives you the property, the name of the form.
=DLookUp("[ID]","[Temp4]","[Name]='" & Form![Name] & "'")
returns the control value.
I'm a big proponent of appropriate use of dot and bang. I like to think example this spells out why quite nicely.
Albeit for an example that should never be required - as Name is a name to be avoided. ;-)
Very well done, Leigh. As always, thanks for taking the time to set us straight. I really enjoy reading your posts.