J
Jane
Hello everyone
I wonder if you could help me with this problem.
I found some code on Google and I can not get it to work
I have a continuous form that includes the controls called
StudentFirstName and StudentSurname
linked to table field names called the same
I would like to sort the form by the 1st and 2nd name and then if clicked
again reverse the sorting.
This is the code I have that is not working and I hope you will be able to
spot were I am going wrong.
Private Sub SortStudentsButton_Click()
If IsNull(Me.OrderBy) Or Me.OrderBy = "[StudentFirstName],[StudentSurname]
DESC" Then
Me.OrderBy = "[StudentFirstName],[StudentSurname]"
Else
Me.OrderBy = "[StudentFirstName],[StudentSurname]" & " DESC"
End If
Me.OrderByOn = True
End Sub
Thank you
Jane Hollin
I wonder if you could help me with this problem.
I found some code on Google and I can not get it to work
I have a continuous form that includes the controls called
StudentFirstName and StudentSurname
linked to table field names called the same
I would like to sort the form by the 1st and 2nd name and then if clicked
again reverse the sorting.
This is the code I have that is not working and I hope you will be able to
spot were I am going wrong.
Private Sub SortStudentsButton_Click()
If IsNull(Me.OrderBy) Or Me.OrderBy = "[StudentFirstName],[StudentSurname]
DESC" Then
Me.OrderBy = "[StudentFirstName],[StudentSurname]"
Else
Me.OrderBy = "[StudentFirstName],[StudentSurname]" & " DESC"
End If
Me.OrderByOn = True
End Sub
Thank you
Jane Hollin