Results 1 to 2 of 2
  1. #1
    Romio is offline Novice
    Windows Vista Access 2007
    Join Date
    Feb 2015
    Posts
    8

    Cannot delete form

    In order to provide some security, i set a way to destroy the database if certain condition is not met.

    The first form opened by the database is a popup login form, asking for a password.
    If the password is good, the following VBA commands are executed:

    DoCmd.Close acForm, "LoginPass_Popup_Frm"
    DoCmd.OpenForm "Main_Menu"

    On the OnLoad event of Main Menu, if a certain condition is not met, all tables, queryes, reports, modules and forms should be erased.
    The odd issue appears when i tried to delete all 80 forms
    Everything is deleted, except the two forms mention above: "LoginPass_Popup_Frm" and "Main_Menu"


    Since the delete call is launched from inside "Main_Menu" form, it is obvious that this one cannot be deleted.
    But i don't understand why I can't delete the "LoginPass_Popup_Frm" form
    To delete the forms, i used the simplest way:

    DoCmd.DeleteObject acForm, "LoginPass_Popup_Frm"

    What can keep this form out of deletion ?
    to be sure the form is closed, i added a DoCmd.Close command in the OnOpen event of "main_menu", but "LoginPass_Popup_Frm" still cannot be deleted.

    Any advice?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    Maybe because code behind Login opens Main_Menu. What happens if you open Main_Menu manually and run the delete code?

    But why do you want to delete these objects? Isn't it more important to protect data?
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 13
    Last Post: 05-06-2014, 12:42 PM
  2. How to delete a record in a form?
    By lawdy in forum Forms
    Replies: 7
    Last Post: 08-19-2013, 03:14 PM
  3. Replies: 2
    Last Post: 01-24-2012, 02:16 PM
  4. Trying to Delete record using delete query
    By MooseOTL in forum Access
    Replies: 13
    Last Post: 10-04-2011, 02:30 AM
  5. How to delete certain field within form?
    By latestgood in forum Programming
    Replies: 1
    Last Post: 06-27-2011, 01:56 AM

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