Sort a form

  • Thread starter Thread starter Jack
  • Start date Start date
J

Jack

I have a form with 4 fields ID#, First name, and Last
Name, based on table MyTable"
Can I sort the form by last name without using a Query?
I see that the form property has a field "Order By" will
this be the place to sort it?
If so, can I have the option of Ascending or Descending?

Thanks
Jack
 
Yes. Set the form's OrderBy property to the name of the field you wish to
sort by.

For a descending sort, add a space and DESC, e.g.:
Me.OrderBy = "[Last Name] DESC"
Me.OrderByOn = True

The sorting is not applied until you switch OrderByOn as well.
 
Thanks
-----Original Message-----
Yes. Set the form's OrderBy property to the name of the field you wish to
sort by.

For a descending sort, add a space and DESC, e.g.:
Me.OrderBy = "[Last Name] DESC"
Me.OrderByOn = True

The sorting is not applied until you switch OrderByOn as well.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.

Reply to group, rather than allenbrowne at mvps dot org.

I have a form with 4 fields ID#, First name, and Last
Name, based on table MyTable"
Can I sort the form by last name without using a Query?
I see that the form property has a field "Order By" will
this be the place to sort it?
If so, can I have the option of Ascending or Descending?

Thanks
Jack


.
 
Back
Top