Results 1 to 15 of 15
  1. #1
    robs23 is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2014
    Posts
    109

    How to display "Please wait" popup everytime Access is loading data from back end


    Hi Guys,

    The server, on which my back end is stored, is terribly slow. I'd like to avoid situation where the user hits for instance "Add Project" button (the button is supposed to display a form that allows new project's entry), front end starts loading the form and required data from back end - and before the form appears on the screen, the user hits the button once more. I noticed that sometimes it takes few seconds to load the form and during that time user can (and knowing my users probably will) hit the button (or some other part of interface) once more. It can make my app crash or work unstable and that's why it is definitely good idea to avoid it.
    I already created appropriate modal form saying "Please wait" that wouldn't allow the user to mess up. Unfortunately, there are many forms (and other bottleneck spots) for which I'd like to use this function. I don't like the idea of revising my whole code and placing
    Code:
    DoCmd.OpenForm.. and DoCmd.Close acForm
    every here and there - isn't there a better way to do so? Could you Guys share your experience in this matter?

    Robert

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    If I do not use the modal form option, the other option I use is to disable the command button that was just clicked.

    So something like...
    Me.SomeOtherField.SetFocus
    Me.cmdButton.Disable
    'Do Something Here
    Me.cmdButton.Enable

  3. #3
    robs23 is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2014
    Posts
    109
    Thanks. I'm looking particularly for a way to detect form's loading state. I know each form has onLoad event and I could open my "Please wait" form there. Is there any event handler NOT within a form but wider, like for a whole database? I'd like to avoid adding my code to each and every form and have all forms triggering my code by default onLoad event.. I know such thing probably doesn't exist in Vba but doesn't hurt to ask.

    RObert

  4. #4
    burrina's Avatar
    burrina is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    That would need to be called via a Module. Can't for the life of me see why you would want to do such a thing?

  5. #5
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    Robert,

    When you open a form are you asking for a specific record or set of records, or are you looking at an entire table?

    If it's really a case of the user hitting the button when they shouldn't, then ItsMe's approach would seem to prevent the second and subsequent clicks that you say cause the issue.

  6. #6
    robs23 is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2014
    Posts
    109
    Hi,

    I have like 20 or so forms, some are used to entry data to tables, some to manipulate data within tables and some just to display data. Often it's a mix of all these things. I know I can disable a button when it's clicked but there are always other buttons user may click then. I believe in approach that an app must be idiot-proof - if there is something that can cause your app crash, someone will definitely do this (no matter how unlikely it seems). That's why I try to find such things upfront and block them..
    I know I can display a modal form that wouldn't allow the user messing things up. I just don't want to code each and every form separately and I'm looking for an easier way. My first guess is to call that modal "Please wait" form from each form's onLoad/onOpen event (depends which one triggers first) and close it when form is fully loaded. Which form's events would be best to start my modal form and which is best for closing it? The start even needs to take place almost immediately after I've hit the button to open form, and the closing event needs to be triggered when the form and all its controls are fully loaded...

    Robert

  7. #7
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    My apps will typically display only one form at a time. If the user is not looking at the main menu they are looking at the form relevant to the task at hand. End of story. If the user needs another window to display historical data, I may employ a pop up form (non-modal) in the interest of real estate.

    I rarely need the Modal property to = Yes. If I use this option it is probably in conjunction with a Yes/No MsgBox where the user wants to input additional info not relative to the current form's recordset.

    I suppose you could write a user defined function that would change the Edit property for the current form to lock all controls. I believe this will affect Command Buttons too. However, I would not call this function in a subsequent form's load event. I would want my locking code to fire in the first line of the click event.

  8. #8
    burrina's Avatar
    burrina is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    What you are asking for makes no sense. As ItsMe has pointed out there are alternatives. What is it you REALLY want to protect? Explain in detail! Idiot proof starts with the design and coding of your forms.

  9. #9
    robs23 is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2014
    Posts
    109
    Ok, I start thinking we don't speak the same language. I have a form A with only 1 button and it opens form B. If user press the button, let's say it takes 10 seconds to display B. In the meantime, the user is confused whether he pressed the button or not. So he press the button once more. What do you think happens then? I think Access will start another instance of B. Am I wrong?

  10. #10
    burrina's Avatar
    burrina is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    I don't know why it would take such a form that long to open! However you could simply create a timed popup form or simple message saying the form will load shortly. Do you have such a form(s) that takes long to open? Surely there are not a lot of them!

  11. #11
    robs23 is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2014
    Posts
    109
    As I said, my company's server is terribly slow and if user connects remotely via VN client, every single form loads that long. Thanks for all your solutions, I'm aware of them. I just don't want to revise every one form to place code to open/close the "please wait" pop-up..

  12. #12
    burrina's Avatar
    burrina is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    As I also mentioned, you could use a module to call a Please Wait for your forms.

    Good Luck!

  13. #13
    robs23 is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2014
    Posts
    109
    @Burrina How do I do that? Can you place a sample code so I know the syntax or what object to use? It'd be very appreciated.

  14. #14
    burrina's Avatar
    burrina is offline VIP
    Windows 8 Access 2010 32bit
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383

    Timed Message

    Here is a DEMO example you could maybe modify to suit your needs. Depends on your skill level. Either way you would have to add code for every form no matter what!
    I did NOT waste a lot of time on this and will not design to your specific needs.

    HTH
    Last edited by burrina; 08-23-2014 at 01:40 PM. Reason: User Downloaded

  15. #15
    robs23 is offline Competent Performer
    Windows 7 64bit Access 2010 32bit
    Join Date
    Apr 2014
    Posts
    109
    Thanks. I'll give it a go when I'm back home

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 0
    Last Post: 10-14-2013, 09:24 AM
  2. Createobject.Popup Opens With "okay" Box, Access 2007
    By David92595 in forum Programming
    Replies: 3
    Last Post: 01-17-2013, 02:52 PM
  3. Write "Edit List Items.." data back to original form.
    By ngahm in forum Database Design
    Replies: 33
    Last Post: 02-27-2012, 06:54 PM
  4. Replies: 4
    Last Post: 01-06-2011, 10:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums