Results 1 to 6 of 6
  1. #1
    nick404's Avatar
    nick404 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2015
    Location
    Wisconsin
    Posts
    352

    Question VBA for a "Please Wait..." message while db C + R on close

    My current database C&R on close and takes a bit since it is a large db. Whenever the user closes the database I would like a simple "Please wait... the database is performing closing operations" message to pop up while the database performs the C + R. I also need it to run a quick append query as well. I have tried using a form that on open runs the query and then runs .closedatabase, but this did not work. The form flashes open for a second and then the close events occur.

    I also tried a message box, but I can't figure out how to get the message box to remain open while the compact and repair is occurring, I have to click OK first..

    Any suggestions appreciated.

  2. #2
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,527
    you cant use message box,
    use a form, with ONLY a big label on it with your message.
    when the db closes, so will the form.

  3. #3
    nick404's Avatar
    nick404 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2015
    Location
    Wisconsin
    Posts
    352
    When i tried to use a form the form opened and closed immediately (too fast to decipher any text) and then the compact and repair began

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    I guess you could create a separate app that executes a CandR on the original app. Your new app could check for an mdb file in the directory. Although, I am having a hard time imagining a need for a User to be aware of a CandR taking place. Why not automate on the weekend on something?

  5. #5
    ssanfu is offline Master of Nothing
    Windows XP Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    Well, first off, a C & R CANNOT have ANY form, message box, dialog box....... any object open, Think about it....how would you compact if an object was open???

    Second, doing a C & R every time the dB is closed can result in a corrupted dB. It happens rarely nowadays, but in the days prior to A2000, C & R on close was not recommended.

    Is you dB split?

    Out of curiosity, why are you doing a C & R every time you close the dB?

  6. #6
    nick404's Avatar
    nick404 is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    May 2015
    Location
    Wisconsin
    Posts
    352
    Well, first off, a C & R CANNOT have ANY form, message box, dialog box....... any object open, Think about it....how would you compact if an object was open???

    Makes sense now that I think about it.

    Yes split database.

    I will be leaving for school next week, and the place of business I am currently employed will be using the database frequently. Because of this I wanted the compact/repair to be automated so the db wouldn't bloat exponentially between now and winter break when I am back.

    Why not automate on the weekend on something?

    As ItsMe stated this would be ideal. Thank you guys!

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

Similar Threads

  1. "Close form" action does not release table
    By TFisher in forum Programming
    Replies: 8
    Last Post: 10-23-2022, 11:54 AM
  2. Lost in loop preventing close from "X" on form
    By Chris033115 in forum Forms
    Replies: 5
    Last Post: 04-16-2015, 01:51 PM
  3. Replies: 5
    Last Post: 09-01-2014, 12:11 PM
  4. Replies: 14
    Last Post: 08-23-2014, 12:35 PM
  5. Suppress "Error" message following "Cancel = True"
    By GraeagleBill in forum Programming
    Replies: 7
    Last Post: 03-23-2014, 05:40 PM

Tags for this Thread

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