Can anyone help me please.
This was my code that basically sorted records displayed in a form by assending order then by descending order if you clicked the header MasterLbl.
Private Sub MasterLbl_Click()
If Me.OrderBy = "[MastRef]" Then
Me.OrderBy = "[MastRef] DESC"
Else
Me.OrderBy = "[MastRef]"
Me.OrderByOn = True
End If
End Sub
This worked a piece of cake, but what I wanted to do was two other data fields to it like thus:
Private Sub MasterLbl_Click()
If Me.OrderBy = "[MastRef],[SubRef],[DiffRef]" Then
Me.OrderBy = "[MastRef] DESC,[SubRef] DESC,[DiffRef] DESC"
Else
Me.OrderBy = "[MastRef],[SubRef],[DiffRef]"
Me.OrderByOn = True
End If
End Sub
But this does not work, how can I get it to sort so that all 3 columns are in order ascending and decsending with each click of the label. Could I do it with an IF statement if I assigned a value to a variable, how would I do that.
Any help would be great.
Thanx
This was my code that basically sorted records displayed in a form by assending order then by descending order if you clicked the header MasterLbl.
Private Sub MasterLbl_Click()
If Me.OrderBy = "[MastRef]" Then
Me.OrderBy = "[MastRef] DESC"
Else
Me.OrderBy = "[MastRef]"
Me.OrderByOn = True
End If
End Sub
This worked a piece of cake, but what I wanted to do was two other data fields to it like thus:
Private Sub MasterLbl_Click()
If Me.OrderBy = "[MastRef],[SubRef],[DiffRef]" Then
Me.OrderBy = "[MastRef] DESC,[SubRef] DESC,[DiffRef] DESC"
Else
Me.OrderBy = "[MastRef],[SubRef],[DiffRef]"
Me.OrderByOn = True
End If
End Sub
But this does not work, how can I get it to sort so that all 3 columns are in order ascending and decsending with each click of the label. Could I do it with an IF statement if I assigned a value to a variable, how would I do that.
Any help would be great.
Thanx