I have a form that displays a company with a subform (datasheet) that shows the contact records linked to that company. I want to sort the contact records by the last name column rather than the ID. After searching the forum, I believe the way to do this is to bind a query to the subform instead of the table.
Sounds easy enough, but I am not exactly sure how to do this. I can create a query and select the fields I want and indicate which column(s) should be sorted. I can go into the properties of the subform and change the record source from the table to the query.
What I can't figure out is how to use the CompanyID from the company record with the query so that I only get the contacts for that company.
I am using Access 2000.
Can anyone provide some guidance for me?
Thanks.
Eric
Sounds easy enough, but I am not exactly sure how to do this. I can create a query and select the fields I want and indicate which column(s) should be sorted. I can go into the properties of the subform and change the record source from the table to the query.
What I can't figure out is how to use the CompanyID from the company record with the query so that I only get the contacts for that company.
I am using Access 2000.
Can anyone provide some guidance for me?
Thanks.
Eric