Hi,
Apologies as I'm sure this is very basic but being new to this it is causing me complete neural breakdown!
I have a form (tabular) on which I want the user to select the sort order by clicking on the labels for each column.
I've used this code and this works well. No problems there:
[purple]Dim sortColumn As String
sortColumn = "[Name]"
Me.OrderBy = sortColumn
Me.OrderByOn = True
Me.Refresh[/purple]
I then wanted to take this a stage further and allow the first click to be sort ascending (default) the second click sort descending. I thought I could establish the current sort order by this method
[purple]currentSort = me!OrderBy[/purple]
Then if it's the same as the clicked sort order set OrderBy as:
[purple]me!OrderBy = sortColumn & " Desc"[/purple]
The problem is I keep getting an error message that Access can't find the field named OrderBy!
Where am I going wrong and how can I establsih the existing value of OrderBy
Thanks
Ray
Apologies as I'm sure this is very basic but being new to this it is causing me complete neural breakdown!
I have a form (tabular) on which I want the user to select the sort order by clicking on the labels for each column.
I've used this code and this works well. No problems there:
[purple]Dim sortColumn As String
sortColumn = "[Name]"
Me.OrderBy = sortColumn
Me.OrderByOn = True
Me.Refresh[/purple]
I then wanted to take this a stage further and allow the first click to be sort ascending (default) the second click sort descending. I thought I could establish the current sort order by this method
[purple]currentSort = me!OrderBy[/purple]
Then if it's the same as the clicked sort order set OrderBy as:
[purple]me!OrderBy = sortColumn & " Desc"[/purple]
The problem is I keep getting an error message that Access can't find the field named OrderBy!
Where am I going wrong and how can I establsih the existing value of OrderBy
Thanks
Ray