oxicottin
Learning by pecking away....
- Local time
- Today, 12:23
- Joined
- Jun 26, 2007
- Messages
- 889
Hello, I have a search form frm_VWI with subform sfrm_VWI and in the subforms header I want to add a command button to sort a field [DateReviewed]. I want to start out with A-Z for the buttons caption and once pressed it sorts the [DateReviewed] and changes the buttons caption to Z-A and when pressed it sorts the field, back and forth with the button. How is this done? I tried but it asked for a parameter value and showed the first date in the first record.
Code:
Private Sub cmdAccDateReviewed_Click()
If Me.OrderBy = [DateReviewed] Then
Me.OrderBy = "[DateReviewed] DESC"
Else
Me.OrderBy = [DateReviewed]
End If
Me.OrderByOn = True
End Sub