L
leroyb
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
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