Results 1 to 3 of 3
  1. #1
    George is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    Feb 2012
    Posts
    295

    Finding a function to close a process

    Good Day All,

    I am using the 'Exit Sub' command in a procedure to close the procedure. However that procedure closes but the procedure that called this procedure continues to function. I want a function that would close all the procedures and allow me to restart from the button command.



    would be grateful for some help.

  2. #2
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,413
    so you need something in the calling procedure to exit the sub - perhaps your called procedure should act5ually be a function that can return a value that the calling procedure can interprete and exit itself e.g.

    Code:
    function calledFunction() as Boolean
    
       if 1=2 then 'continue
           ...
           ...
       else
           calledfunction=false
           exit function
       end if
    
    end function
    
    sub calling procedure
    
        if calledfunction=false then exit sub
    
    end sub

  3. #3
    George is offline Competent Performer
    Windows 7 64bit Access 2013 64bit
    Join Date
    Feb 2012
    Posts
    295
    Thanks. The function suggestion is a good idea. I have employed it and that's just fine.

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

Similar Threads

  1. What function to use this process
    By azhar2006 in forum Forms
    Replies: 2
    Last Post: 10-05-2014, 02:20 PM
  2. Replies: 0
    Last Post: 06-08-2014, 02:33 PM
  3. Replies: 1
    Last Post: 03-20-2014, 07:51 AM
  4. Function to close reports
    By Ruegen in forum Programming
    Replies: 1
    Last Post: 03-16-2014, 05:42 PM
  5. Replies: 4
    Last Post: 01-31-2014, 11:47 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