Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2005
    Posts
    121

    Unanswered: Deleting a Form in Macro

    All,
    I have an application where it is a second version. The user will initially open the program to a "Start" form which is not the original start form. The form will guide the user to import history from the previous version, then close the form and open another form that should run a macro that will delete "Start", then rename "StartOriginal" to "Start". Then open "Start".

    The original start form once the history is imported only is coded to close and open the next form which is hidden "Import". Import has the on open command to run the macro to delete and rename the start forms.

    But, it keeps telling me I cannot delete Start while it is open. By the time the second form "Import" opens and executes the macro, Start should be closed. Am I missing something?

  2. #2
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Well, at what point you explicitly close the Start form?

    Is there a possibility of just deploying the new version of the application and providing an import feature? This would be MUCH cleaner and less irritating to maintain than having a version that deletes a bunch of its own objects. I believe PKStormy has a whole setup for doing this automagically in the code bank thread.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  3. #3
    Join Date
    May 2010
    Posts
    601
    Quote Originally Posted by Bob.Carter.17 View Post
    All,
    I have an application where it is a second version. The user will initially open the program to a "Start" form which is not the original start form. The form will guide the user to import history from the previous version, then close the form and open another form that should run a macro that will delete "Start", then rename "StartOriginal" to "Start". Then open "Start".

    The original start form once the history is imported only is coded to close and open the next form which is hidden "Import". Import has the on open command to run the macro to delete and rename the start forms.

    But, it keeps telling me I cannot delete Start while it is open. By the time the second form "Import" opens and executes the macro, Start should be closed. Am I missing something?
    I would avoid deleting any objects.

    The way I deploy updates is to simple replace the front end with the new front end. On startup the new front end relinks to the back end.

    If the update does include table changes, then after relinking to the back end, I have the the code check to see if the updates have been applied. If not, then I run VBA to apply the changes.

    I also only deploy my front end as an MDE to protect it from any design changes. This means that you can not delete any forms.

    Is your application split?
    Boyd Trimmell aka HiTechCoach HiTechCoach.com (free access stuff)
    Microsoft MVP - Access Expert
    BPM/Accounting Systems/Inventory Control/CRM
    Programming: Nine different ways to do it right, a thousand ways to do it wrong.
    Binary--it's as easy as 1-10-11

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •