OderBy Help

  • Thread starter Thread starter Rick
  • Start date Start date
R

Rick

I have a continuous form which lists open assignemnts for my department.
Each assignemt has a Reference#, a call ticket #, and a user to which it is
assigned. On my form header, I put buttons (to serve as column headings).
In the 'onclick property of these buttons, I would like to put code that
will resort the continuous records in my detail section based on which
button is clicked. I tried the following code, but it does not work.

Private Sub OrderCMS_Click()
Forms!frmtestUserID.OrderBy = Ticket#
End Sub

Private Sub OrderInstaller_Click()
Forms!frmtestUserID.OrderBy = UserID

End Sub

Private Sub OrderReference_Click()
Forms!frmtestUserID.OrderBy = Reference
End Sub

Can anyone tell me what I'm doing wrong?
Does anyone have a better suggestion?
Could I have done a label with an 'onclick' property to accomplish the same
thing (but look more normal)?


THANKS IN ADVANCE for any help you can provide.

Rick Bear
 
You can use labels or buttons, but just make sure the
user knows that they need to click the button to re-sort
the data.
I would suggest this:

Private Sub OrderCMS_Click()
me.OrderBy = "[Ticket#]"
me.OrderByOn=True
End Sub

Private Sub OrderInstaller_Click()
me.OrderBy = "[UserID]"
me.OrderByOn=True

End Sub

Private Sub OrderReference_Click()
me.OrderBy = "[Reference]"
me.OrderByOn=True
End Sub
 
Back
Top