How to pop up "Busy Message" while running a process in ms access

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • yuvang
    New Member
    • Oct 2008
    • 20

    How to pop up "Busy Message" while running a process in ms access

    Please help on how to show a busy message like "Please wait" or a "analytical animated watch" in ms access when a process in running.
  • youmike
    New Member
    • Mar 2008
    • 69

    #2
    You need to identify the event which starts the process - clicking a control on a form, or whatever. In the VBA code for that event you simply add:

    Code:
    msgbox("BUSY RUNNING PROCESS")
    .

    This will cause a small window to appear, which the user can close by clicking on the OK button. You can make the msgbox function more complex. Try searching the VBA Help file for details.

    Comment

    • yuvang
      New Member
      • Oct 2008
      • 20

      #3
      We can pop up the msg through msgbox option. but it will pop up with "OK" button and it will go off once the ok button clicked. then only the next line of code will be executed.


      My expectation is to pop up that msg without "OK" button option and that msg should be there until the current running process completes, then automatically the msg should go off.

      It is nothing but when a query or long process is running in system at the time our cursor symbol will change to "busy" mode. Thats i want as msg in our ms access, nothing else than that.

      Comment

      • GazMathias
        Recognized Expert New Member
        • Oct 2008
        • 228

        #4
        Originally posted by yuvang
        Please help on how to show a busy message like "Please wait" or a "analytical animated watch" in ms access when a process in running.
        Normal way is:

        Code:
        Dim statusmsg as Variant
        
            statusmsg = SysCmd(acSysCmdRemoveMeter)
            statusmsg = SysCmd(acSysCmdSetStatus, "Posting invoices to ledgers, please wait.")
        This will appear on the status bar at the bottom left of the screen.

        Gaz.

        Comment

        • yuvang
          New Member
          • Oct 2008
          • 20

          #5
          I have removed the status bar in "StartUp". So if that is like Message will look good........

          Comment

          • DonRayner
            Recognized Expert Contributor
            • Sep 2008
            • 489

            #6
            Have whatever process you start set a global variable and open a custom form. Have it unset the variable when the process is done running.

            Use the on timer event of the custom form to monitor the status of the global variable and to close the form when it's unset.

            Comment

            • yuvang
              New Member
              • Oct 2008
              • 20

              #7
              Can you please provide an example........ ...

              Comment

              • DonRayner
                Recognized Expert Contributor
                • Sep 2008
                • 489

                #8
                Originally posted by yuvang
                Can you please provide an example........ ...
                Create a standard module and declare a public variable at the top

                Code:
                Public YourVar as string
                In your process code put this at the top

                Code:
                YourVar = "running"
                Docmd.openform "YourFormName"
                And this at the exit point

                Code:
                YourVar = ""
                In the forms on timer event put this

                Code:
                If YourVar = "running" Then
                    Exit Sub
                Else
                    Docmd.close
                End If

                Comment

                • yuvang
                  New Member
                  • Oct 2008
                  • 20

                  #9
                  Hi i have done that but still that is not working to me....


                  Let me explain what i have done...

                  i kept the below line

                  Code:
                  Public YourVar As String
                  in a module


                  then the



                  Code:
                  YourVar = "Please Wait"
                  in a on (Opens a form)click process in the same at the last i kept


                  Code:
                  YourVar = ""

                  then i kept the below code in same form's timer

                  Code:
                   If YourVar = "Please Wait" Then
                       Exit Sub
                   Else
                       DoCmd.Close
                   End If

                  Comment

                  • GazMathias
                    Recognized Expert New Member
                    • Oct 2008
                    • 228

                    #10
                    Originally posted by yuvang
                    Code:
                     If YourVar = "Please Wait" Then
                         Exit Sub
                     Else
                         DoCmd.Close
                     End If
                    Hi,

                    Looks like you need to reset the timer:

                    Code:
                     If YourVar = "Please Wait" Then
                         Me.TimerInterval = 1000
                         Exit Sub
                     Else
                         DoCmd.Close
                     End If
                    Also make sure its switched on to begin with.

                    Find the Form's "Timer Interval" property and put 1000 in there. This equates to one second, if memory serves.

                    So the above will run every one second until the variable is off, at which point the timer is not reset and the form closes.

                    Gaz

                    Comment

                    • yuvang
                      New Member
                      • Oct 2008
                      • 20

                      #11
                      You have given some code. But i am not clear that where i need to use them. So that i am not able to get any output. could you please clarify that ?

                      Comment

                      • DonRayner
                        Recognized Expert Contributor
                        • Sep 2008
                        • 489

                        #12
                        Originally posted by yuvang
                        You have given some code. But i am not clear that where i need to use them. So that i am not able to get any output. could you please clarify that ?
                        Create a standard module and name it anything you want. Using VBA editor declare your public variable (whatever name you want) at the top of the module.

                        Using VBA editor edit the process you want the popup for and set your variable to = "Please Wait" and DoCmd.openform "Your Message Form" at the start of the process module. At the end of the process module set your variable back to nothing "".

                        In your message form properties change the timer value to 1000, in the on timer event add the code that was provided.

                        I'm sorry if I'm not explaining this clear enough for you but I've never been accused of being a good instructor. If it's still unclear what you need to do, maybe someone else can explain it better than I.

                        Comment

                        • yuvang
                          New Member
                          • Oct 2008
                          • 20

                          #13
                          Let me explain about my mdb.

                          It has a form “A” and there is a button to open another form “B”. While opening the form “B” it getting very late. So that what I want to display a message as “Please Wait”. The message should be there until the form “B” opens.


                          To this what I need to do. Please explain…..

                          Comment

                          • GazMathias
                            Recognized Expert New Member
                            • Oct 2008
                            • 228

                            #14
                            Originally posted by yuvang
                            Let me explain about my mdb.

                            It has a form “A” and there is a button to open another form “B”. While opening the form “B” it getting very late. So that what I want to display a message as “Please Wait”. The message should be there until the form “B” opens.


                            To this what I need to do. Please explain…..
                            Can I just ask why form "B" is taking so long to open? What does it do?

                            How often (if ever) do you Compact & Repair the .mdb?

                            Comment

                            • yuvang
                              New Member
                              • Oct 2008
                              • 20

                              #15
                              Hi



                              Can I just ask why form "B" is taking so long to open? What does it do?

                              Ans: The form "B" is having so many queries and 30 subforms, where i controlled them through visibilities.


                              How often (if ever) do you Compact & Repair the .mdb?

                              Ans: I am not Compact & Repair the mdb, once i post that to production server. are there any possibilities to that automatically.. ......

                              Comment

                              Working...