Changing the mouse pointer

K

Khalid

Hey everyone,

I need someone's help one something. What I want to do is
change the mouse pointer into an hour glass before I
connect to a DB (cause it takes a few seconds to execute,
and I don't want the user to think nothing is going on.

Here is what I did:

Me.MousePointer= fmMousePointerHourGlass

....connect to DB and stuff

Me.MousePointer= fmMousePointerDefault

But the pointer doesn't change. The funny thing is that
when I run the debugger and pur breakpoints, it does in
fact change.

Can someone help me out?? Thank you advance
 
J

Jean-Guy Marcil

Bonjour,

Dans son message, < Khalid > écrivait :
In this message, < Khalid > wrote:

|| Hey everyone,
||
|| I need someone's help one something. What I want to do is
|| change the mouse pointer into an hour glass before I
|| connect to a DB (cause it takes a few seconds to execute,
|| and I don't want the user to think nothing is going on.
||
|| Here is what I did:
||
|| Me.MousePointer= fmMousePointerHourGlass
||
|| ...connect to DB and stuff
||
|| Me.MousePointer= fmMousePointerDefault
||
|| But the pointer doesn't change. The funny thing is that
|| when I run the debugger and pur breakpoints, it does in
|| fact change.
||
|| Can someone help me out?? Thank you advance

I am not sure, but I am going to make a wild guess here...
Maybe that when you connect to the DB, the focus is momentarily off the
userform, so the pointer shape is no longer dictated by the form, until it
gets the focus back from the ODBC operation, but then the procedure moves
right on to the next line of code, so you do not have the time to see the
hourglass?

Try a "system" call instead. Play with the following code and see if it does
anything...
'_______________________________________
Dim lgWait As Long

StatusBar = "Please wait..."

For lgWait = 1 To 900000
System.Cursor = wdCursorWait
Next lgWait

StatusBar = "Task completed"
System.Cursor = wdCursorNormal
'_______________________________________

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
[email protected]
Word MVP site: http://www.word.mvps.org
 
Top