Sort Ascending on Subform

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
 
G

Guest

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
 
R

Roger Carlson

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
 
W

weircolin

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top