4

I have a button in my access form ,when clicks it checks some code to find data in excel cells. It is taking a while to finish the process. By that time i need to display Please wait message to users.

I'm calling this method, but not working

         Sub plswaitmsg()
         Dim statusmsg As Variant
         statusmsg = SysCmd(acSysCmdRemoveMeter)
         statusmsg = SysCmd(acSysCmdSetStatus, "Loading dropdown data,please wait.")
         End Sub

3 Answers 3

3

You could use this status bar in execution mode. http://christopherjmcclellan.wordpress.com/2014/03/08/progress-bar-for-ms-access/

It's a bit much to post here in it's entirety, but it relies on two big things. The first is that you can create a new instance of any form on the fly in your code. This hinges on the fact that Access forms are really just glorified class modules. You can try it yourself by saving a new form with the default name "Form1", and then placing this code in a regular *.bas module.

Sub ShowForm()
    Dim frm as New Form_Form1
    frm.Visible = True

    Stop
End Sub

Note that I put a breakpoint in because the form will auto-destruct when it goes out of scope.

The second big thing is using DoEvents to give the OS enough time to repaint the screen.

Understanding these two things, you should be able to design a form with a textbox that changes size as your process runs. Also, I would actually recommend a UserForm instead of an Access Form. I didn't know it at the time, but you can use UserForms not just in Excel, but also in Access.

Sign up to request clarification or add additional context in comments.

1 Comment

Also had to set the form's ShowModal property to false
2

You cant display a MsgBox in Excel without pausing execution of the marco. You should use the Status Bar to display the message

Application.StatusBar = "Please be patient..."

then to clear it

Application.StatusBar = False

2 Comments

Thank you for reply. But it is not working in access.
in Access it is SysCmd acSysCmdSetStatus, "your message" which looks like what you had above...is I don't see what a MsgBox has to do with this?
-1

Here is a very easy way:

The true process ending time is latest code line.

  • So you put finish massage as label caption above end sub code line.
  • Then wait massage label caption should be before processing.
  • Your command button can then use "please wait" message in mouse down input instead click input.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.