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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Subform with Dlookup, almost works...

Status
Not open for further replies.

GaborH

Technical User
Nov 5, 2003
48
0
0
US
I have a continuous form tbl_Projects_resources, that operates as a subform. User selects a project to staff, then on the subform, selects a ResourceNo via a combo box. The next field over from resource box is Name of the employee associated with the ResourceNo. The field Name does not exist on the table tbl_Projects_resources, but merely appears on the subform via the command =DLookUp("[Name]","Qry_Resources","[ResourceNo]=Form![ResourceNo]").

When the form tbl_Projects_resources is run by itself, the everything works. Meaning, as the ResourceNo is selected, the appropriate Name appears. There is also a macro, triggered by event when ResourceNo changes. It has only two lines that serve to update field Name. (line 1, SelectObject /Form / tbl_Projects_resources line 2, Requery / Control Name/ Name )

However, when the form is run as a subform, I get the following message.

The object tbl_Projects_resources isn’t open.
The macro you are running (directly or indirectly) contains a GoToRecord, Repaint Object, or SelectedObject action, but the Object Name argument names an object that is closed. The object name argument for the GoToRecord, Repain Object, or SelectObject method names an Object that is closed. Use of the Open Action method to open the object so that you can carry out the desired action.

 
Sorry about the rambling explanation. I have no idea what I doing wrong. Any help, or hints are highly appreciated.
Thank you,

GaborH
 
Have you tried this ?
=DLookUp("[Name]","Qry_Resources","[ResourceNo]=" & Me![ResourceNo])

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top