DLOOKUP in subform not working

S

SVE

Here's the situation. Working with tech support for Access, I finally was
able to write the correct DLOOKUP expression in a subform field in Access
2000/Windows XP Home Edition. It worked fine. I went to work and typed in
the same code with minor changes for referencing the correct tables/queries,
and it wouldn't work, they have Access 2003/Windows XP Pro. I used the VB
editor to trouble shoot the code, and it pulled up the correct values with no
problem for each individual piece, using a specific value, and using the
whole code referencing the form and subform. Can anyone give me any help as
to why the expression won't work?

Thanks for any guidance.

SVE
 
S

Steve Schapel

SVE,

I, for one, would certainly be happy to see if I can help. What's the
expression which is causing problems? What result are you getting? And
what result did you expect?
 
S

SVE

Hi Steve,

Thanks for wanting to help, but I was able to get it working today by doing
an extended reference expression.
Here's what I had--=DLookUp("[City]","Zip Codes Query","[ZipCode]='" &
Forms!Companies![Sites subform]!PhysicalZip & "'").

Here's what fixed it--=DLookUp("[City]","[Zip Codes Query]","[ZipCode]='" &
Forms!Companies![Sites subform].Form!PhysicalZip & "'")

Thanks for the help.

SVE
 
Top