Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 1 / April 2006

Tip: Looking for answers? Try searching our database.

Delay of Hourglass

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Henry Stockbridge - 04 Apr 2006 15:44 GMT
Hi,

I am running the following code and the visibility of the Hourglass
appears late, instead of immediately.  Any ideas of how I can remedy
this?

=============

Private Sub lblUpdateMDList_Click()

Docmd.Hourglass True

Dim dbs As DAO.Database
Dim sSQL As String

Set dbs = CurrentDb()

' 1) Delete and append records
sSQL = "DROP TABLE tblRepLookUp"
dbs.Execute sSQL
 sSQL = "SELECT qryMDHospRep.hosCustomerID, "
 sSQL = sSQL & "qryMDHospRep.phyPhysicianID, "
 sSQL = sSQL & "qryMDHospRep.SalesRepID, qryMDHospRep."
 sSQL = sSQL & "SalesRepFirstName, qryMDHospRep."
 sSQL = sSQL & "SalesRepLastName, qryMDHospRep.SalesRep, "
 sSQL = sSQL & "qryMDHospRep.SalesRepType, qryMDHospRep."
 sSQL = sSQL & "RegionRepID, qryMDHospRep."
 sSQL = sSQL & "RegionManagerFirstName, qryMDHospRep."
 sSQL = sSQL & "RegionManagerLastName, qryMDHospRep."
 sSQL = sSQL & "RegionManager INTO tblRepLookUp "
 sSQL = sSQL & "FROM qryMDHospRep;"

dbs.Execute sSQL

Docmd.Hourglass False

  MsgBox "Physician List Complete", vbInformation + vbOKOnly, "Process
Complete"
 Set dbs = Nothing

End Sub

====================

Thanks in advance,

Henry
tommaso.gastaldi@uniroma1.it - 04 Apr 2006 21:02 GMT
hi Henry ,

in the .Net languages I have seen often the following schema:

       Application.DoEvents()
       Cursor.Current = Cursors.WaitCursor

       ' ... intensive task here ...

       Cursor.Current = Cursors.Default
       Application.DoEvents()

can you do something similar in the language you are you using ? Le me
know...

-t

Henry Stockbridge ha scritto:

> Hi,
>
[quoted text clipped - 43 lines]
>
> Henry
Bob Quintal - 04 Apr 2006 22:29 GMT
> hi Henry ,
>
[quoted text clipped - 12 lines]
>
> -t

Doevents is all one needs in VBA.

Docmd.Hourglass True
DoEvents

Dim dbs As DAO.Database
Dim sSQL As String

Set dbs = CurrentDb()

Q

> Henry Stockbridge ha scritto:
>
[quoted text clipped - 46 lines]
>>
>> Henry

Signature

Bob Quintal

PA is y I've altered my email address.

tommaso.gastaldi@uniroma1.it - 04 Apr 2006 23:24 GMT
Interesting.

It's also remarkable to note how in the .net context it is crucial the
position of the doevents w.r.t. the cursor setting (and this, according
Bob's suggestion, should be different from VBA):

"Note   If you call Application.DoEvents before resetting the Current
property back to the Cursors.Default cursor, the application will
resume listening for mouse events and will resume displaying the
appropriate Cursor for each control in the application."

see:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlr
fSystemWindowsFormsCursorClassTopic.asp


Bob Quintal ha scritto:

> > hi Henry ,
> >
[quoted text clipped - 75 lines]
> >>
> >> Henry
Henry Stockbridge - 05 Apr 2006 13:13 GMT
Thanks for the help. - Henry
Henry Stockbridge - 05 Apr 2006 13:13 GMT
Thanks for the help. - Henry
Henry Stockbridge - 30 Apr 2006 11:55 GMT
Well, I almost had it....

I can trigger the hourglass, but then it disappears, the system looks
like it is idle for 30 seconds or so, and then the Message Box appears.
I would expect something more immediate.  Any ideas or solutions?
'====================================
Private Sub lblUpdateMDList_Click()
 On Error GoTo PROC_ERR
 Dim dbs As DAO.Database
 Dim sSql As String
 Set dbs = CurrentDb()

 DoCmd.Hourglass True
 DoEvents

 ' 1) Delete and append records
 sSql = "DROP TABLE tblRepLookUp"
 dbs.Execute sSql
 sSql = "SELECT qryMDHospRep.hosCustomerID, "
 sSql = sSql & "qryMDHospRep.phyPhysicianID, "
 sSql = sSql & "qryMDHospRep.SalesRepID, qryMDHospRep."
 sSql = sSql & "SalesRepFirstName, qryMDHospRep."
 sSql = sSql & "SalesRepLastName, qryMDHospRep.SalesRep, "
 sSql = sSql & "qryMDHospRep.SalesRepType, qryMDHospRep."
 sSql = sSql & "RegionRepID, qryMDHospRep."
 sSql = sSql & "RegionManagerFirstName, qryMDHospRep."
 sSql = sSql & "RegionManagerLastName, qryMDHospRep."
 sSql = sSql & "RegionManager INTO tblRepLookUp "
 sSql = sSql & "FROM qryMDHospRep;"
 dbs.Execute sSql

 DoCmd.Hourglass False
 MsgBox "Physician List Complete", vbInformation + vbOKOnly, "Process
Complete"

 Set dbs = Nothing

 Exit Sub

PROC_ERR:
 MsgBox "The following error occured: " & Error$
 Resume Next
End Sub
'==========================

Thanks in advance,

Henry
Lyle Fairfield - 30 Apr 2006 12:52 GMT
I never use DoCmd Hourglass being entirely satisfied 99.94% of the time
with the Access GUI straight from the box.
I see you've pasted this problem more than once so I'll chip in with my
!!!GUESS!!! which is that Access turns the Hourglass off automatically
after

sSql = "DROP TABLE tblRepLookUp"
dbs.Execute sSql

and that you might !!!TRY!!! moving
DoCmd.Hourglass True
DoEvents

to the line immediately following those.

In passing, I suppose you have considered that most accomplished
developers would not drop and create the tblRepLookUp but simply refer
directly to the query that you are using to populate it. One can assume
that the query executes slowly, as you are using the Hourglass; perhaps
this requires attention?

In addition, I recall in the olden days when Access and hardware were
much slower but I was quicker, I set the Status Bar on when running a
slow query; this gave an automatic progress bar  at the bottom of the
screen tracking query execution progress.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.