I have the following RowSource set up, but I need to change it due to structural changes in the database and policy changes. [Forms]![Company]![Company] is a ComboBox that contains a company name and a company ID in a hidden column. The hidden column is new and I haven't yet figured out how to modify the listboxes rowsource to reflect this change. Ideally, I want to change the search so it is looking for the Company_ID rather than a company name.
Code:
SELECT companycomments.[Entered Date], companycomments.[Comment By], IIf(Len(companycomments.comment)>=50,Left(companycomments.comment,47) & "...",companycomments.comment) AS Comment, companycomments.[Follow Up Date], companycomments.[Follow Up By], companycomments.CommentID, companies.Company
FROM companies INNER JOIN companycomments ON companies.Company = companycomments.Company
WHERE (((companies.Company)=[Forms]![Company]![Company]))
GROUP BY companycomments.[Entered Date], companycomments.[Comment By], companycomments.[Follow Up Date], companycomments.[Follow Up By], companycomments.CommentID, companies.Company, companycomments.Comment
ORDER BY companycomments.[Entered Date] DESC;