Sort records in form programmatically
- From: "leroyb" <bertrand.leroy@xxxxxxxxx>
- Date: 17 Feb 2006 01:01:12 -0800
Hello,
using Access97 and WinNT
I am trying to have the records displayed on a continuous form sorted
programmatically by using the click event of the column label.
The forms displays a bunch of records, one of the fields is Date
Submitted .... when the user clicks on the label in the form header,
the records would then be sorted by Date. Clicking on the other labels
would sort the records accordingly.
The above works, however I would like to be able to switch between
Ascending and Descending .. to do that I have the following code
Me.OrderByOn = False
Me.OrderBy = ""
If Me.OrderBy = "[RI_Date] ASC" Then
Me.OrderBy = "[RI_Date] DESC"
Else
Me.OrderBy = "[RI_Date] ASC"
End If
Me.OrderByOn = True
Me.Filter = "source = 1"
Me.FilterOn = True
...... but that above does not work :( .... it only keeps on displaying
[RI_Date] in the Order By property of the form .... and obviously the
sort order does not change.
Could someone show me how to achieve this?
thanks,
regards,
Bertrand
.
- Follow-Ups:
- Re: Sort records in form programmatically
- From: Arvin Meyer [MVP]
- Re: Sort records in form programmatically
- Prev by Date: Re: Subform survey problem
- Next by Date: Re: I need to link my own help to my ms access application !!
- Previous by thread: RE: Problem locating record using a combobox in a subform
- Next by thread: Re: Sort records in form programmatically
- Index(es):
Relevant Pages
|