G
Guest
Hi! I'm trying to run some simple code that re-sorts the data in a form that
I am viewing when I click on a field label but I cannot get the cursor to
change to an hourgalss. I have tried putting it in both subs and I tried
putting it just in the "click" sub or just in the "SetOrderBy" sub but
nothing seems to work! What am I doing wrong?
-----------------------------------------------------------------------------
Private Sub SetOrderBy(newOrderBy As String)
DoCmd.Hourglass True
Dim curOrderBy, AscDesc As String
curOrderBy = Me.OrderBy & " "
curOrderBy = Left(curOrderBy, InStr(curOrderBy, " ") - 1)
AscDesc = IIf(UCase(Right(RTrim(Me.OrderBy), 4)) = "DESC", "", " DESC")
If curOrderBy <> newOrderBy Then AscDesc = ""
Me.OrderBy = newOrderBy & AscDesc
Me.OrderByOn = True
DoCmd.Hourglass False
End Sub
-----------------------------------------------------------
Private Sub excp_cret_dt_Label_Click()
SetOrderBy ("excp_cret_dt")
End Sub
-----------------------------------------------------------------------
Private Sub excp_num_Label_Click()
DoCmd.Hourglass True
SetOrderBy ("excp_num")
DoCmd.Hourglass False
End Sub
I am viewing when I click on a field label but I cannot get the cursor to
change to an hourgalss. I have tried putting it in both subs and I tried
putting it just in the "click" sub or just in the "SetOrderBy" sub but
nothing seems to work! What am I doing wrong?
-----------------------------------------------------------------------------
Private Sub SetOrderBy(newOrderBy As String)
DoCmd.Hourglass True
Dim curOrderBy, AscDesc As String
curOrderBy = Me.OrderBy & " "
curOrderBy = Left(curOrderBy, InStr(curOrderBy, " ") - 1)
AscDesc = IIf(UCase(Right(RTrim(Me.OrderBy), 4)) = "DESC", "", " DESC")
If curOrderBy <> newOrderBy Then AscDesc = ""
Me.OrderBy = newOrderBy & AscDesc
Me.OrderByOn = True
DoCmd.Hourglass False
End Sub
-----------------------------------------------------------
Private Sub excp_cret_dt_Label_Click()
SetOrderBy ("excp_cret_dt")
End Sub
-----------------------------------------------------------------------
Private Sub excp_num_Label_Click()
DoCmd.Hourglass True
SetOrderBy ("excp_num")
DoCmd.Hourglass False
End Sub