A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Allowing Temporary Sorting



 
 
Thread Tools Display Modes
  #1  
Old May 4th, 2010, 08:24 PM posted to microsoft.public.access.forms
Williams
external usenet poster
 
Posts: 39
Default Allowing Temporary Sorting

I have a form that I always want to appear with the records displayed in sort
order. The end users may sort the data by any column desired, but whenever
the form is displayed I want it to open up with the records sorted by Date.
The form is based upon a query which identified that the DATE field should be
sorted in Ascending order. The properties of the form have also been
updated to reflect that the records should be "Ordered by" DATE.

Whenever a user opens the form and sorts by an alternate field the form
retains the sort order of the last user even though the form does not request
to save the layout changes. How can I prevent this from happening?
  #2  
Old May 4th, 2010, 09:14 PM posted to microsoft.public.access.forms
fredg
external usenet poster
 
Posts: 4,386
Default Allowing Temporary Sorting

On Tue, 4 May 2010 12:24:01 -0700, Williams wrote:

I have a form that I always want to appear with the records displayed in sort
order. The end users may sort the data by any column desired, but whenever
the form is displayed I want it to open up with the records sorted by Date.
The form is based upon a query which identified that the DATE field should be
sorted in Ascending order. The properties of the form have also been
updated to reflect that the records should be "Ordered by" DATE.

Whenever a user opens the form and sorts by an alternate field the form
retains the sort order of the last user even though the form does not request
to save the layout changes. How can I prevent this from happening?


The Form's recordsource is a query ordered by the [DateField]?
Turn off the Form's OrderByOn property in the Form's Load event.

Me.OrderByOn = False

The query's sort will appear on the form.
When the user changes the sort the OrderByOn property will be set to
True until the next time the form is opened or the user right-clicks
on the form and selects Remove Filter/Sort.
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:35 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.