Results 1 to 3 of 3
  1. #1
    Roncc is offline Advanced Beginner
    Windows 10 Access 2010 32bit
    Join Date
    Dec 2017
    Posts
    91

    Use of code to close forms


    I use the following code attached to a button to close forms for a program I am writing: "DoCmd.close acForm, "NAMEOFFORM"". To simplify my work I want to make a list of forms , prepare a DoCmd.close acForm for each one, then paste this entire list into the onerror section for several of my code windows. In some cases a form on the list may not be open. Am I asking for trouble by using code to close a form when it is not actually open?

    Thanks for the help.

    Ron C

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,627
    Apparently not. Just tested and no error message.
    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.

  3. #3
    Roncc is offline Advanced Beginner
    Windows 10 Access 2010 32bit
    Join Date
    Dec 2017
    Posts
    91
    I tested it too and found no problem but I wanted to ask the pros. Thank you so much for taking the time to help, I really appreciate it.

    Ron C.

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

Similar Threads

  1. Close Form Code
    By swenger in forum Forms
    Replies: 7
    Last Post: 11-23-2017, 09:37 PM
  2. Code Close Form
    By mortonsafari in forum Forms
    Replies: 3
    Last Post: 07-18-2017, 11:25 PM
  3. Close form with code
    By CoachPoffy in forum Programming
    Replies: 6
    Last Post: 01-07-2015, 08:38 AM
  4. Replies: 1
    Last Post: 02-12-2011, 10:30 AM
  5. should i close inactive forms
    By Mclaren in forum Forms
    Replies: 1
    Last Post: 07-07-2010, 02:39 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