I have a Table, we will call it tblPeople:
Expand|Select|Wrap|Line Numbers
- Field Type Description
- ID AutoNumber PK
- FullName Text Person's Name (Last, First MI)
- Other fields, etc.
SOME (I say again, SOME) of these people have circumstances which pertain only to them. So, for proper DB normalization, we have a separate table for just these people. We will call it tblGoodPeople:
Expand|Select|Wrap|Line Numbers
- Field Type Description
- ID AutoNumber PK
- Person Long FK to tblPeople
- Other fields, etc.
In tblGoodPeople, I use a LookUp field, RowSourceType = Table/Query and RowSource =
Expand|Select|Wrap|Line Numbers
- SELECT tblPeople.ID, tblPeople.FullName
- FROM tblPeople
- ORDER BY tblPeople.FullName;
However, there is a neat feature available when you have foreign keys and you have a lookup field. Here is an example.
All you have to do is use the Prefix "Lookup_" and indicate the Lookup Field that you want to use (assuming you had multiple fields to sort on). Thus, I set my OrderBy Property to:
Expand|Select|Wrap|Line Numbers
- Lookup_Person.FullName
And my table now sorts by the person's name!
There is nothing ground-breaking in this insight and many of the Experts here may have already known about this trick. However, for some of the younger Jedis, this little secret about the Force is given to help out.
Enjoy this little tidbit of MS Access trickery.....