Results 1 to 4 of 4
  1. #1
    Sarge, USMC is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Oct 2010
    Posts
    43

    Alphabetizing form data

    I have a couple of forms in my DB that don't display records in alphabetical order.
    The table these forms draw their data from are sorted alphabetically by last name, but the records are not being sorted and displayed in form view.

    This is only happening with a few forms. All the rest work normally.

    What am I missing?





    Semper Fi

  2. #2
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    When you 'sort' a Table, you're actually only telling Access how you want to see the data in Table View, i.e. when you're looking directly at the Table, but the underlying data, in the Table, remains in the same order as it was before you sorted it, and this is how it is seen by the Form that is based on the Table.

    Many of us prefer to base Forms on Queries, even when we're only using a single Table. You can then sort the data, in the Query, however you want, then base your Form on the Query.

    Second option is, in Form Design View, set the Form's Order By On Load Property to Yes, and set the
    Order By Property to the Field you want to sort by, including Square Brackets around the Field Name. So:

    Order By On Load: Yes
    Order By: [FieldNameToSortBy]

    If you want to sort on Multiple Fields:

    Order By: [FirstSortFieldName],[SecondSortFieldName]

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  3. #3
    Sarge, USMC is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Oct 2010
    Posts
    43
    Thanks. I didn't see an "Order By On Load" field, but there is an "Order By" field, and I did what you told me to do and it worked fine.
    I understand what you're telling me regarding basing forms on queries. Next DB I build, I'll have to try that.

    Thanks again.

  4. #4
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Order By On Load should be the next Property down from Order By, but it worked because it's set to Yes by Default in most, if not all, versions of Access.

    Actually it's quite easy to convert an existing Form's RecordSource from a Table to a single-table Query. You simply

    1. Use the Query Wizard to make the Query from the Table
    2. Include all Fields from the Table
    3. Open the Form in Design View
    4. GO to Properties - Data
    5. Use the Record Source Property dropdown to change it from the Table to the Query


    You're done!

    Good luck with your project!

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 5
    Last Post: 08-12-2013, 12:53 AM
  2. Replies: 1
    Last Post: 07-16-2012, 02:10 PM
  3. Replies: 4
    Last Post: 12-22-2011, 03:04 AM
  4. Replies: 1
    Last Post: 12-21-2011, 02:11 PM
  5. Replies: 4
    Last Post: 01-05-2011, 07:56 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums