Sort Ascending on Subform

  • Thread starter Thread starter weircolin
  • Start date Start date
W

weircolin

Hi

I have a form with a subform on it in the format of one of the tables.
When I open the form it does not show the entries in alphabetical
order, so I right click it and go to "Sort Ascending". When I close
the form and reopen it, it again is not sorted. If I open the subform
it is sorted there.

Does anyone have any ideas on how to get this to work?

Thanks

Colin
 
Do you always want the subform sorted this way? If so, put this code in the
form's OnLoad event:

Me.OrderBy = "MyFieldName"
Me.OrderByOn = True

Barry
 
If you always want them sorted alphabetically, you should base your subform
on a Query of the table (sorted however you want) rather than directly on
the Table. BTW, I rarely base a form on a table because I generally want
the data sorted somehow.

--
--Roger Carlson
MS Access MVP
Access Database Samples: www.rogersaccesslibrary.com
Want answers to your Access questions in your Email?
Free subscription:
http://peach.ease.lsoft.com/scripts/wa.exe?SUBED1=ACCESS-L
 
Hi

Both worked, thank you!

Hadn't been thinking properly (Friday morning) and was sorting the
table and not sorting the querie I had based it on! Sorry for being as
silly!

Thanks again

Colin
 
Back
Top