Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show a field on a form not in record source

Status
Not open for further replies.

Cozmo2

Technical User
Apr 7, 2006
87
US
I have a form that has data & several command buttons that open other secondary forms. I want to put a field from one of the secondary forms onto the primary form. What is the best way to accomplish this?
Thanks for any help you can give me.
 
#error is returned on my form. here is my code (in Control Source): =DLookUp("Area","[Graduation Information]","[soc_sec] = Forms![Graduation Information]!soc_sec").
Area is a Field in the Graduation Information Table

Where am I going wrong?
Thanks for you help.
 
What about this ?
=Nz(DLookUp("Area","[Graduation Information]","[soc_sec] = Forms![Graduation Information]!soc_sec"),"")

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks for your response. Unfortunately, the
#error is still returned on my form. I tried changing Forms to Table, didn't help. I also added Tables! before the first "[Graduation Information]" like this:
=Nz(DLookUp("Area","Tables![Graduation Information]","[soc_sec] = Forms![Graduation Information]!soc_sec"),"") and received:
The Microsoft Jet database engine cannot find the input table or query Tables![Graduation Information]. Make sure it exists and that its name is spelled correctly. The table does exist.
 
DLookUp("Area","[Graduation Information]","[soc_sec] = Forms![Graduation Information]!soc_sec")
Obviously [Graduation Information] is an open main form with a populated control named soc_sec, and soc_sec and Area are some fields in the [Graduation Information] table ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Graduation Information is a form that can be accessed through a command button on the main form StudentInformation. Graduation Information is not opened. The Graduation Information table does contain the soc_sec and the area fields.
 
Graduation Information is not opened.
So, the #Error is normal behaviour ...

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Can I perform a Dlookup on a table that is closed?
 
The problem is not the table but the form.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks for the help. I think I need to figure out a different approach.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top