I have three tables relevant to this discussion:
Members
Events
Activities
Activities is formally related as a child of both Members and Events.
I create child Activities records with the Events Form and the embedded continuous Activities_Ev sub-form
The sub-form contains a Combo box (Member_Name), used to select a person in the Members table to whom this Events' Activities_Ev child record should link. It displays the name properly. Just so there is no question about how I am managing the linking, I also provided an OnClick event procedure for the combo box, to take the Member's ID, bound column(0), and assign it to the linking field in the child record, to properly associate the child record with the members parent record, as below.
Private Sub Member_Name_OnClick()
[Member_ID] = [Member_Name].Column(0)
End Sub
That all works fine. I found this is a handy feature, which I recently learned how to do. I now use it in several similar places in the database.
But, when I attempt to sort on the combobox, it sorts by the bound column(0), not the combo box column(1), which contains the member's name, and which is displayed in the combobox.
I tried setting the sub-form Order By property to [Member_Name].Column(1), but that it not understood by Access. I also tried quotes around that command. It did not cause an error, and it did change the sort order. However, it is not alphabetical, just some apparently other random sort order.
How do I get the sub-form to sort by the text value in the combobox instead of the bound column?