forms closing

  • Thread starter Thread starter mon
  • Start date Start date
M

mon

Hi All, My opening form shows records by critical dates
(future dates). A command button opens a form showing open
reports by due dates. On that form I would like a button
to "reorder open reports by their job numbers". Once I am
in that view the button should "reorder open reports (BACK
TO) by due dates)? Thanks Monika
 
Enter the following code in the click event of the button:
If Me.OrderBy = "JobNumbers" Then
Me.OrderBy = "DueDates"
Else
Me.OrderBy = "JobNumbers"
End If
Me.OrderByOn = True
 
Thanks, Joel, works so well that I would now like to do it
for the other three fields I have; Claimant, Client and
employee. The due dates and jobnumber order are the main
ones. Also can the text on the button be changed to say
which order it is?
Thanks, Mon
 
Since you want to be able to order by more then 2 fields
i would suggest using the following code:
Select Case Button.Caption
Case "DueDates"
Me.OrderBy = "JobNumber"
Button.Caption = "JobNumber"
Case "JobNumber"
Me.OrderBy = "Claimant"
Button.Caption = "Claimant"
Case "Claimant"
Me.OrderBy = "Client"
Button.Caption = "Client"
Case "Client"
Me.OrderBy = "employee"
Button.Caption = "employee"
Case "employee"
Me.OrderBy = "DueDates"
Button.Caption = "DueDates"
End Select
 
Back
Top