Solved

Easy question

Posted on 2000-05-04
6
175 Views
Last Modified: 2011-09-20
How do I make it so that when a user click on btnSave,

The cursor turns into an hourglass
and nothing else can be done while save is in progress.

Thanks
0
Comment
Question by:sopheak
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 5

Expert Comment

by:AnswerTheMan
ID: 2779165
Screen.MousePointer=vbHourGlass
0
 
LVL 5

Expert Comment

by:AnswerTheMan
ID: 2779166
to release :
Screen.MousePointer=vbDefault
0
 

Author Comment

by:sopheak
ID: 2779181
I tried it, but I can still click on other buttons (even with the hourglas cursor) while the save is in progress.  Am I missing something?

0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 70

Accepted Solution

by:
Éric Moreau earned 50 total points
ID: 2779199
Just turning the mouse pointer doesn't stop user from clicking elsewhere.

You can use this:

Private Sub Command1_Click()
Dim dtmstart As Date

Screen.MousePointer = vbHourglass
Me.Enabled = False

'Simulate some process
dtmstart = Now
Do Until DateAdd("s", 15, dtmstart) < Now
    DoEvents
Loop

Me.Enabled = True
Screen.MousePointer = vbDefault
Beep
End Sub
0
 

Author Comment

by:sopheak
ID: 2779209
Thanks, that was it
0
 

Expert Comment

by:maxwseven
ID: 2779211
I usually do this to deal with that problem :

 I don't know how heavy your application is but, I usually put all my buttons on a container
( Ex. PictureBox ).

Then put the picturebox without border and the correct BackColor so that you can not tell that there is a picturebox on the form. When the "Save" is in progress, put the picturebox like so :

 MousePointer = vbHourGlass
 Picture1.enabled = false
 
 'Job...
 'Job...
 'Job...
 'Job finished

 Picture1.enabled = true
 Mousepointer = vbDefault

 OK !

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month4 days, 23 hours left to enroll

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question