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

Query fields cannot be changed or updated- why?

Status
Not open for further replies.

Dophia

Technical User
Jul 26, 2004
263
CA
Hi Everyone: I have a form based on two tables (tblAnimals and tblAdmission_description) that are joined by a common field (Pound_Sheet_No). I have a query that calculates the age of an animal (QryDOB). When I add it to the query with the two tables, I cannot update the form. Is it because the query has an expression in it?

SELECT tblAnimals.Pound_Sheet_No, tblAnimals.Animal_ID, tblAnimals.Arrival_Date, tblAnimals.Category_ID, tblAnimals.[Animal's_Name], tblAnimals.Date_of_birth, tblAnimals.Age_Estimated, tblAnimals.Age_Estimated_Mth_Yr, QryDOB.AgeNew, QryDOB.ShelterTime, tblAdmission_description.Admission_description, tblAdmission_description.PS_No, tblAdmission_description.Sick, tblAdmission_description.Injured, tblAdmission_description.Deceased, tblAdmission_description.Abandoned, tblAdmission_description.At_Large
FROM (tblAnimals LEFT JOIN QryDOB ON tblAnimals.Pound_Sheet_No = QryDOB.Pound_Sheet_No) INNER JOIN tblAdmission_description ON tblAnimals.Pound_Sheet_No = tblAdmission_description.PS_No
WHERE (((tblAnimals.Category_ID)="dog"));

Thanks for any help,
Sophia
 
You aren't just joining two tables. You are including QryDOB.

When you come here with a question like this, you should provide the SQL of QryDOB as well as the primary and foreign key fields.

Duane
Hook'D on Access
MS Access MVP
 
Thanks for the advise Duane. I decided to do it another way since the QryDOB is complicated. I added the QryDOB to a subform and added it on the form that way.

Sophia
 
Also, help yourself and those you expect to help you by simplifying your SQL, like...
Code:
SELECT
  a.Pound_Sheet_No
, a.Animal_ID
, a.Arrival_Date
, a.Category_ID
, a.[Animal's_Name]
, a.Date_of_birth
, a.Age_Estimated
, a.Age_Estimated_Mth_Yr
, d.AgeNew
, d.ShelterTime
, m.Admission_description
, m.PS_No
, m.Sick
, m.Injured
, m.Deceased
, m.Abandoned
, m.At_Large

FROM (
 tblAnimals a LEFT JOIN
 QryDOB d
  ON a.Pound_Sheet_No = d.Pound_Sheet_No) INNER JOIN
 tblAdmission_description m
  ON a.Pound_Sheet_No = m.PS_No

WHERE (((a.Category_ID)="dog"));

Skip,

[glasses]Just traded in my old subtlety...
for a NUANCE![tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top