Problem editing values returned by query (1 Viewer)

April15Hater

Accountant
Local time
Today, 04:51
Joined
Sep 12, 2008
Messages
349
Hi Guys-

I have three tables in this scenario: tblFunction, tblContractorFunction, and tblInvoiceFunction. tblContractorFunction and tblInvoiceFunction have a 1-M relationship to tblFunction yet share FunctionType as the common foreign key (which is actually a text value). I want the query to list the FunctionTypes as the rows with the cost as one column and the price in another. My SQL below did that but I need to be able to edit the cost and price values which it is not allowing me to do. I attached my relationship diagram as well.

<EDIT>FORGOT TO MENTION: When I have just (tblFunction and tblContractorFunction) or (tblFunction and tblInvoiceFunction) alone, I can update but obviously by doing that, the corresponding Price/Cost (respectively) will not show.

Thanks,

Joe


Code:
SELECT tblInvoiceFunction.Price, tblContractorFunction.FunctionCost, 
tblContractorFunction.FunctionType, tblInvoiceFunction.FunctionType

FROM (tblFunction INNER JOIN tblInvoiceFunction ON 
tblFunction.FunctionID = tblInvoiceFunction.FunctionID) INNER JOIN 
tblContractorFunction ON (tblContractorFunction.FunctionType = 
tblInvoiceFunction.FunctionType) AND (tblFunction.FunctionID = 
tblContractorFunction.FunctionID)

WHERE (((tblFunction.FunctionID)=3));
 

Attachments

  • SKMBT_C450100128135901.jpg
    SKMBT_C450100128135901.jpg
    53.8 KB · Views: 75
Last edited:

Banana

split with a cherry atop.
Local time
Today, 01:51
Joined
Sep 1, 2005
Messages
6,318
Joe

Can't remember if you already saw this but that was handy in determining what could be cause for the query becoming read-only.

From the list and going off that query you have, my first guess would be to verify the columns in the join are indexed.

Also, the SQL seems to re-join table twice, which may be the cause.

You also can verify if everything is correct by starting out simple - do a simple two table join, then add another one, and see what happens.
 

Users who are viewing this thread

Top Bottom