Query Records not editable

  • Thread starter Thread starter Dragon
  • Start date Start date
D

Dragon

Hi

I created the following query to get some data from my tables. Everything
work fine except I cannot edit the records returned by the query. It seem
they are read only. Could anyone please tell me how do I go about getting
these records to be editable?

Thank you.

SELECT

tblCars.Car_ID, tblCars.Dealer_ID, tblCars.Car_Make_ID,
tblCars.Car_Model_ID, tblCars.Purchase_Date, tblCars.Purchasing_Agent,
tblCars.Purchase_Price, tblCars.Color_At_Purchase, tblCars.Chasis_No,
tblCars.Engine_No, tblCars.Reg_No, tblCars.Date_First_Registered,
tblCars.Speedometer_At_Purchase, tblCars.Purchase_Notes, tblCars.Sold,
tblCars.Date_Sold, tblCars.Color_At_Sale, tblCars.[Speedometer_At-Sale],
tblCars.Sale_Agent, tblCars.Cust_ID, tblCars.Sale_Price,
tblCars.Car_Exchange, tblCars.Exchange_Car_ID, tblCars.Sale_Notes,
tblCarMake.Car_Make, tblCarModel.Car_Model, tblCustomers.Cust_First_Name,
tblCustomers.Cust_Last_Name, tblCustomers.Cust_Address_Line1,
tblCustomers.Cust_Address_Line2, tblCustomers.Cust_Address_Line3,
tblCustomers.Cust_City, tblCustomers.Cust_PostCode, tblCustomers.Cust_Phone,
tblCustomers.Cust_Mobile, tblCustomers.Cust_Note, tblCustomers.Deactivated,
tblDealers.Dealer_Name, tblDealers.Contact_Name, tblDealers.Dealer_Address,
tblDealers.Dealer_Address2, tblDealers.Dealer_City,
tblDealers.Dealer_PostCode, tblDealers.Dealer_Phone,
tblDealers.Dealer_Phone2, tblDealers.Dealer_WebSite,
tblDealers.Dealer_Email, tblDealers.Dealer_Notes,
Sum(tblDeposit.Deposit_Amount) AS SumOfDeposit_Amount,
Sum(tblParts.Part_Price) AS SumOfPart_Price

FROM tblDealers

INNER JOIN ((((tblCarMake INNER JOIN tblCarModel ON tblCarMake.Car_Make_ID
= tblCarModel.Car_Make_ID)
INNER JOIN (tblCustomers INNER JOIN tblCars ON tblCustomers.Cust_ID =
tblCars.Cust_ID) ON tblCarModel.Car_Model_ID = tblCars.Car_Model_ID)
LEFT JOIN tblDeposit ON tblCars.Car_ID = tblDeposit.Car_ID) LEFT JOIN
tblParts ON tblCars.Car_ID = tblParts.Car_ID) ON tblDealers.Dealer_ID =
tblCars.Dealer_ID

GROUP BY tblCars.Car_ID, tblCars.Dealer_ID, tblCars.Car_Make_ID,
tblCars.Car_Model_ID, tblCars.Purchase_Date, tblCars.Purchasing_Agent,
tblCars.Purchase_Price, tblCars.Color_At_Purchase, tblCars.Chasis_No,
tblCars.Engine_No, tblCars.Reg_No, tblCars.Date_First_Registered,
tblCars.Speedometer_At_Purchase, tblCars.Purchase_Notes, tblCars.Sold,
tblCars.Date_Sold, tblCars.Color_At_Sale, tblCars.[Speedometer_At-Sale],
tblCars.Sale_Agent, tblCars.Cust_ID, tblCars.Sale_Price,
tblCars.Car_Exchange, tblCars.Exchange_Car_ID, tblCars.Sale_Notes,
tblCarMake.Car_Make, tblCarModel.Car_Model, tblCustomers.Cust_First_Name,
tblCustomers.Cust_Last_Name, tblCustomers.Cust_Address_Line1,
tblCustomers.Cust_Address_Line2, tblCustomers.Cust_Address_Line3,
tblCustomers.Cust_City, tblCustomers.Cust_PostCode, tblCustomers.Cust_Phone,
tblCustomers.Cust_Mobile, tblCustomers.Cust_Note, tblCustomers.Deactivated,
tblDealers.Dealer_Name, tblDealers.Contact_Name, tblDealers.Dealer_Address,
tblDealers.Dealer_Address2, tblDealers.Dealer_City,
tblDealers.Dealer_PostCode, tblDealers.Dealer_Phone,
tblDealers.Dealer_Phone2, tblDealers.Dealer_WebSite,
tblDealers.Dealer_Email, tblDealers.Dealer_Notes;
 
A totals query is always nonupdatable....and your query is a totals query.

You'll need to look at rewriting the query to make it a Select query and to
use the DSum function for the calculated fields where you're now using the
Sum function.

--
Ken Snell
<MS ACCESS MVP>

Dragon said:
Hi

I created the following query to get some data from my tables. Everything
work fine except I cannot edit the records returned by the query. It seem
they are read only. Could anyone please tell me how do I go about getting
these records to be editable?

Thank you.

SELECT

tblCars.Car_ID, tblCars.Dealer_ID, tblCars.Car_Make_ID,
tblCars.Car_Model_ID, tblCars.Purchase_Date, tblCars.Purchasing_Agent,
tblCars.Purchase_Price, tblCars.Color_At_Purchase, tblCars.Chasis_No,
tblCars.Engine_No, tblCars.Reg_No, tblCars.Date_First_Registered,
tblCars.Speedometer_At_Purchase, tblCars.Purchase_Notes, tblCars.Sold,
tblCars.Date_Sold, tblCars.Color_At_Sale, tblCars.[Speedometer_At-Sale],
tblCars.Sale_Agent, tblCars.Cust_ID, tblCars.Sale_Price,
tblCars.Car_Exchange, tblCars.Exchange_Car_ID, tblCars.Sale_Notes,
tblCarMake.Car_Make, tblCarModel.Car_Model, tblCustomers.Cust_First_Name,
tblCustomers.Cust_Last_Name, tblCustomers.Cust_Address_Line1,
tblCustomers.Cust_Address_Line2, tblCustomers.Cust_Address_Line3,
tblCustomers.Cust_City, tblCustomers.Cust_PostCode, tblCustomers.Cust_Phone,
tblCustomers.Cust_Mobile, tblCustomers.Cust_Note, tblCustomers.Deactivated,
tblDealers.Dealer_Name, tblDealers.Contact_Name, tblDealers.Dealer_Address,
tblDealers.Dealer_Address2, tblDealers.Dealer_City,
tblDealers.Dealer_PostCode, tblDealers.Dealer_Phone,
tblDealers.Dealer_Phone2, tblDealers.Dealer_WebSite,
tblDealers.Dealer_Email, tblDealers.Dealer_Notes,
Sum(tblDeposit.Deposit_Amount) AS SumOfDeposit_Amount,
Sum(tblParts.Part_Price) AS SumOfPart_Price

FROM tblDealers

INNER JOIN ((((tblCarMake INNER JOIN tblCarModel ON tblCarMake.Car_Make_ID
= tblCarModel.Car_Make_ID)
INNER JOIN (tblCustomers INNER JOIN tblCars ON tblCustomers.Cust_ID =
tblCars.Cust_ID) ON tblCarModel.Car_Model_ID = tblCars.Car_Model_ID)
LEFT JOIN tblDeposit ON tblCars.Car_ID = tblDeposit.Car_ID) LEFT JOIN
tblParts ON tblCars.Car_ID = tblParts.Car_ID) ON tblDealers.Dealer_ID =
tblCars.Dealer_ID

GROUP BY tblCars.Car_ID, tblCars.Dealer_ID, tblCars.Car_Make_ID,
tblCars.Car_Model_ID, tblCars.Purchase_Date, tblCars.Purchasing_Agent,
tblCars.Purchase_Price, tblCars.Color_At_Purchase, tblCars.Chasis_No,
tblCars.Engine_No, tblCars.Reg_No, tblCars.Date_First_Registered,
tblCars.Speedometer_At_Purchase, tblCars.Purchase_Notes, tblCars.Sold,
tblCars.Date_Sold, tblCars.Color_At_Sale, tblCars.[Speedometer_At-Sale],
tblCars.Sale_Agent, tblCars.Cust_ID, tblCars.Sale_Price,
tblCars.Car_Exchange, tblCars.Exchange_Car_ID, tblCars.Sale_Notes,
tblCarMake.Car_Make, tblCarModel.Car_Model, tblCustomers.Cust_First_Name,
tblCustomers.Cust_Last_Name, tblCustomers.Cust_Address_Line1,
tblCustomers.Cust_Address_Line2, tblCustomers.Cust_Address_Line3,
tblCustomers.Cust_City, tblCustomers.Cust_PostCode, tblCustomers.Cust_Phone,
tblCustomers.Cust_Mobile, tblCustomers.Cust_Note, tblCustomers.Deactivated,
tblDealers.Dealer_Name, tblDealers.Contact_Name, tblDealers.Dealer_Address,
tblDealers.Dealer_Address2, tblDealers.Dealer_City,
tblDealers.Dealer_PostCode, tblDealers.Dealer_Phone,
tblDealers.Dealer_Phone2, tblDealers.Dealer_WebSite,
tblDealers.Dealer_Email, tblDealers.Dealer_Notes;
 
Back
Top