Home > Archive > MS Access database support > April 2006 > Delay of Hourglass









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Delay of Hourglass
Henry Stockbridge

2006-04-04, 11:34 am

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_Clic
k()

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 & " RegionManagerFirstNa
me, qryMDHospRep."
sSQL = sSQL & " RegionManagerLastNam
e, 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

2006-04-04, 8:30 pm

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,
>
> 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_Clic
k()
>
> 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 & " RegionManagerFirstNa
me, qryMDHospRep."
> sSQL = sSQL & " RegionManagerLastNam
e, 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


Bob Quintal

2006-04-04, 8:30 pm

tommaso.gastaldi@uniroma1.it wrote in
news:1144180970.674314.206570@g10g2000cwb.googlegroups.com:

> 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


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:
>
>




--
Bob Quintal

PA is y I've altered my email address.
tommaso.gastaldi@uniroma1.it

2006-04-04, 8:30 pm

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/d...rClassTopic.asp

Bob Quintal ha scritto:

> tommaso.gastaldi@uniroma1.it wrote in
> news:1144180970.674314.206570@g10g2000cwb.googlegroups.com:
>
>
> Doevents is all one needs in VBA.
>
> Docmd.Hourglass True
> DoEvents
>
> Dim dbs As DAO.Database
> Dim sSQL As String
>
> Set dbs = CurrentDb()
>
> Q
>
>
>
>
> --
> Bob Quintal
>
> PA is y I've altered my email address.


Henry Stockbridge

2006-04-05, 9:35 am

Thanks for the help. - Henry

Henry Stockbridge

2006-04-05, 9:35 am

Thanks for the help. - Henry

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com