473,769 Members | 3,857 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Delay of Hourglass

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.ho sCustomerID, "
sSQL = sSQL & "qryMDHospRep.p hyPhysicianID, "
sSQL = sSQL & "qryMDHospRep.S alesRepID, qryMDHospRep."
sSQL = sSQL & "SalesRepFirstN ame, qryMDHospRep."
sSQL = sSQL & "SalesRepLastNa me, qryMDHospRep.Sa lesRep, "
sSQL = sSQL & "qryMDHospRep.S alesRepType, qryMDHospRep."
sSQL = sSQL & "RegionRepI D, qryMDHospRep."
sSQL = sSQL & "RegionManagerF irstName, qryMDHospRep."
sSQL = sSQL & "RegionManagerL astName, qryMDHospRep."
sSQL = sSQL & "RegionMana ger 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

Apr 4 '06 #1
7 4284
hi Henry ,

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

Application.DoE vents()
Cursor.Current = Cursors.WaitCur sor

' ... intensive task here ...

Cursor.Current = Cursors.Default
Application.DoE vents()

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 _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.ho sCustomerID, "
sSQL = sSQL & "qryMDHospRep.p hyPhysicianID, "
sSQL = sSQL & "qryMDHospRep.S alesRepID, qryMDHospRep."
sSQL = sSQL & "SalesRepFirstN ame, qryMDHospRep."
sSQL = sSQL & "SalesRepLastNa me, qryMDHospRep.Sa lesRep, "
sSQL = sSQL & "qryMDHospRep.S alesRepType, qryMDHospRep."
sSQL = sSQL & "RegionRepI D, qryMDHospRep."
sSQL = sSQL & "RegionManagerF irstName, qryMDHospRep."
sSQL = sSQL & "RegionManagerL astName, qryMDHospRep."
sSQL = sSQL & "RegionMana ger 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


Apr 4 '06 #2
to************* *@uniroma1.it wrote in
news:11******** **************@ g10g2000cwb.goo glegroups.com:
hi Henry ,

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

Application.DoE vents()
Cursor.Current = Cursors.WaitCur sor

' ... intensive task here ...

Cursor.Current = Cursors.Default
Application.DoE vents()

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:
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.ho sCustomerID, "
sSQL = sSQL & "qryMDHospRep.p hyPhysicianID, "
sSQL = sSQL & "qryMDHospRep.S alesRepID, qryMDHospRep."
sSQL = sSQL & "SalesRepFirstN ame, qryMDHospRep."
sSQL = sSQL & "SalesRepLastNa me, qryMDHospRep.Sa lesRep, "
sSQL = sSQL & "qryMDHospRep.S alesRepType, qryMDHospRep."
sSQL = sSQL & "RegionRepI D, qryMDHospRep."
sSQL = sSQL & "RegionManagerF irstName, qryMDHospRep."
sSQL = sSQL & "RegionManagerL astName, qryMDHospRep."
sSQL = sSQL & "RegionMana ger 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

PA is y I've altered my email address.
Apr 4 '06 #3
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.DoE vents 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/de...ClassTopic.asp

Bob Quintal ha scritto:
to************* *@uniroma1.it wrote in
news:11******** **************@ g10g2000cwb.goo glegroups.com:
hi Henry ,

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

Application.DoE vents()
Cursor.Current = Cursors.WaitCur sor

' ... intensive task here ...

Cursor.Current = Cursors.Default
Application.DoE vents()

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:
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.ho sCustomerID, "
sSQL = sSQL & "qryMDHospRep.p hyPhysicianID, "
sSQL = sSQL & "qryMDHospRep.S alesRepID, qryMDHospRep."
sSQL = sSQL & "SalesRepFirstN ame, qryMDHospRep."
sSQL = sSQL & "SalesRepLastNa me, qryMDHospRep.Sa lesRep, "
sSQL = sSQL & "qryMDHospRep.S alesRepType, qryMDHospRep."
sSQL = sSQL & "RegionRepI D, qryMDHospRep."
sSQL = sSQL & "RegionManagerF irstName, qryMDHospRep."
sSQL = sSQL & "RegionManagerL astName, qryMDHospRep."
sSQL = sSQL & "RegionMana ger 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

PA is y I've altered my email address.


Apr 4 '06 #4
Thanks for the help. - Henry

Apr 5 '06 #5
Thanks for the help. - Henry

Apr 5 '06 #6
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.ho sCustomerID, "
sSql = sSql & "qryMDHospRep.p hyPhysicianID, "
sSql = sSql & "qryMDHospRep.S alesRepID, qryMDHospRep."
sSql = sSql & "SalesRepFirstN ame, qryMDHospRep."
sSql = sSql & "SalesRepLastNa me, qryMDHospRep.Sa lesRep, "
sSql = sSql & "qryMDHospRep.S alesRepType, qryMDHospRep."
sSql = sSql & "RegionRepI D, qryMDHospRep."
sSql = sSql & "RegionManagerF irstName, qryMDHospRep."
sSql = sSql & "RegionManagerL astName, qryMDHospRep."
sSql = sSql & "RegionMana ger 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

Apr 30 '06 #7
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.

Apr 30 '06 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
5294
by: kaeli | last post by:
Hey all, This is a nitpick that I'd like to fix if possible... I have a form that submits to a page that does some intense DB queries, so the page takes about 30-45 seconds to load. Using Win2K, IE6, when the submit button is clicked, it looks like nothing is happening (unless you read the status bar and see the page opening text). Yet Netscape shows a little hourglass, indicating that processing is occurring. Is there a simple way to...
3
6562
by: Zlatko Matić | last post by:
I have a procedure that takes certain time to finish. It is triggered by pushing botton, but a user can't see whether the procedure started or not, because Access starts showing hourglass cca 20 seconds after the button was pushed. I would like to add some hourglass or a message that would be present on the screen while procedure is runing. How to accomplish it ? Thanks.
0
1266
by: Mike Zhang | last post by:
I am working on a webcam application using javascripts timer reload. The internet explore mouse cursor changed to hourglass when loading. It annoy me and my users a lot. How to get rid of hourglass when loading new image?
3
6999
by: Andy G | last post by:
This should be very simple but I can't figure it out or find ANYTHING posted about how to change your cursor to an hourglass. I have a ASP.NET web form using VB.NET code behind. When I click on a button I want the cursor to change to an hourglass and then change back to the normal cursor afterwards. Any help would be greatly appreciated. Thanks.
8
16995
by: Eddie | last post by:
Hi All, I just want to change the mouse cursor during a process. I want a hourglass... How may I do it ? Thx
6
6371
by: Lars | last post by:
Hi, I have created a simple custom PrintPreviewDialog consisting of a simple standard PrintPreviewControl (.NET 1.1) on a WindowsForm with a few buttons (for printing, zooming, etc.). It is working fine, except for that I cannot figure out how display the waitcursor / hourglass while the preview is preparing to show the document *and then go back to the default cursor when the document is displayed*. Turning on the waitcursor is easy,...
5
6549
by: awu | last post by:
All: I want to turn my hourglass around to indicate my program is still running. I am using VBA with Excel and MS Access 2000. So far I use DoCmd.Hourglass true and false to turn on/off hour glass. Thank you in advance awu10
3
6776
by: bob | last post by:
Is there anyway to show the hourglass (busy) cursor on the entire monitor screen, not just when the cursor is within the current program's window? Thanks
6
11572
by: Tomek | last post by:
In my page I reload JavaScript. When it is reloading the cursor change to "wait" (hourglass). After javascript loaded it does not change back to the "hand" if cursor stay on hyperlinks. How can I turn off changing cursor to "wait" (hourglass) is javascript is reloading.
0
9589
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9423
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10048
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9865
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8872
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6674
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5304
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3963
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3563
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.