I am trying to run an update query to count the number of records in a related table and store the count in the main table. For example: I have a table with inquiries (tblInquiry) with a field ResponseCount. I have another table (tblInquiryReply). I am trying to run the attached code but apparently I am doing something wrong once again.
I am getting an error that states: The expresion you entered refers to an object that is closed or dosen't exist. (Run-time error 2467). Is my code way off or am I close?Code:DoCmd.RunSQL "Update tblInquiry set tblInquiry.ResponseCount = Count(InquiryRespID) from tblInquiryReply where tblInquiry.InquiryID = " & Me.InquiryID
Thanks.