Hi All,
I have a report that shows the data from my Information table.
One of the columns is called First_Name and under that header i have a button which sorts them into ascending order using the code below.
What I want to happen is, when the user clicks it once it sorts it into ascending order, and when they click it a second time it sorts into descending order
I understand I need to use an If/Else statement but I'm not sure how to write it, is it along the lines of..
any help would be appreciated.
I have a report that shows the data from my Information table.
One of the columns is called First_Name and under that header i have a button which sorts them into ascending order using the code below.
Code:
Private Sub btnFirstName_Click()
Me.OrderBy = "[FirstName] Asc"
Me.OrderByOn = True
End Sub
I understand I need to use an If/Else statement but I'm not sure how to write it, is it along the lines of..
Code:
Private Sub btnFirstName_Click()
If btnFirstName = True Then
btnFirstName.OrderBy = "[FirstName] Asc"
Me.OrderByOn = True
Exit Sub
Else
btnFirstName.OrderBy = "[FirstName] Desc"
Me.OrderByOn = True
End If
End Sub