Navigation:  Articles > Sep-1997 >

Tip: Don't End Any Field Name with "desc"

Previous pageReturn to chapter overviewNext page

Steve Clark          
 
With Access 2.0, I was in the habit of giving fields names that ended in "desc." For instance, if I had a field called "Code" and another field that contained the descriptive text for that code, I called that field "CodeDesc." But with Access 95, fields that end with "Desc" can be misinterpreted by the Order By property in tables, forms, and reports. To see this in action:
 
1. Create a table, tblItems, with fields ItemID and ItemDesc.
 
2. Add dummy data.
 
3. Sort ItemDesc in Ascending order in the table's datasheet view.
 
4. Close and Save the changes to the layout.
 
5. Open the table again in datasheet view. The Enter Parameter Value dialog box asking for the value of tblItems.Item will appear.
 
To see how Access messed up, open tblItems in Design View and look at the Table's Order By Properties. It will show tblItems.Item DESC, indicating that the table should be sorted in Descending order by the non-existing field Item.