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!

Parameter in a sub query

Status
Not open for further replies.

LonnieJohnson

Programmer
Apr 16, 2001
2,628
US
I want to use a sub query to determine the value for an update query. My problem is using one of the fields in the main query's table as a parm in the sub query like so...


Code:
UPDATE tempDemand SET tempDemand.resourcesAvailable = (SELECT ResourcesAvailable FROM qrySupplyResult WHERE Role =   [tempDemand]![Role]);

Does that make sense?

ProDev, MS Access Applications
Visit me at ==>
May God bless you beyond your imagination!!!
 
UPDATE tempDemand INNER JOIN qrySupplyResult ON tempDemand.Role = qrySupplyResult.Role
SET tempDemand.resourcesAvailable = qrySupplyResult.ResourcesAvailable

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks. I did that at first and got a message saying the I must use an updateble query. That's when I went to this try. I finally did it with a recordset object in vba.

ProDev, MS Access Applications
Visit me at ==>
May God bless you beyond your imagination!!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top