Hourglass Control

  • Thread starter Thread starter Phil
  • Start date Start date
P

Phil

Developers,

I have a form with one sub-form in it. When users click a
sub-form label, it re-sorts the data by that field. That
parts works, but I would like to display an hourglass
while the sort takes place. I have tried all sorts ideas,
but when the Orderby statements takes place it appears
that Access takes over the mouse pointer regardless of my
VB statments and keeps the pointer as an Arrow. Any
ideas???? (See below for code) It looks like on 6/17/2003
Matthew Saunders posted the same problem.

Public Sub Change_Order(Field_Name As String)
Dim Order As String
Dim Full_Name As String
Dim Full_Name_DESC As String

'Cant get the mouse pointer to switch to an
hourglass???
Screen.MousePointer = 11
DoCmd.Echo False, "Sorting..."
DoCmd.Hourglass True

Order = Me.OrderBy
Full_Name = "[" & Field_Name & "]"
Full_Name_DESC = Full_Name & " DESC"

Select Case Order
Case Full_Name
Me.OrderBy = Full_Name_DESC
Case Full_Name_DESC
Me.OrderBy = Full_Name
Case Else
Me.OrderBy = Full_Name
End Select

Me.OrderByOn = True

Call Label_Colors_Reset

DoCmd.Hourglass False
DoCmd.Echo True
Screen.MousePointer = 1

End Sub
 
Back
Top