I have a button on a form with the following code on click. This sorts the records in Ascending order. How would I modify the code to sort in Descending order.
Private Sub SortName_Click()
On Error GoTo Err_SortNameBtn_Click
'Sorts the records by Surname in Ascending order
Me.OrderBy = "Surname"
Me.OrderByOn = True
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
Exit_SortNameBtn_Click:
Exit Sub
Err_SortNameBtn_Click:
MsgBox Err.Description
Resume Exit_SortNameBtn_Click
End Sub
Private Sub SortName_Click()
On Error GoTo Err_SortNameBtn_Click
'Sorts the records by Surname in Ascending order
Me.OrderBy = "Surname"
Me.OrderByOn = True
DoCmd.DoMenuItem acFormBar, acRecordsMenu, 5, , acMenuVer70
Exit_SortNameBtn_Click:
Exit Sub
Err_SortNameBtn_Click:
MsgBox Err.Description
Resume Exit_SortNameBtn_Click
End Sub