Results 1 to 2 of 2
  1. #1
    Ruegen's Avatar
    Ruegen is offline VIP
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2013
    Location
    Australia
    Posts
    1,496

    Exclamation Exit Sub not working

    I have



    Code:
    'save booking without emailing button
    Private Sub Button_SaveBooking_Click()
    
    
    Call RemainingSeatsUpdate
    
    
    If Calc < 0 Then
        MsgBox "You cannot save as you have gone below the allowed seating."
        Exit Sub
    End If
    
    
    If InvalidEmailCheck(Me.Text_TeacherEmail) = True Then
        MsgBox "The email you have provided is not valid, please correct this."
        Exit Sub
    End If
    
    
    If tagMustComplete("MustComplete", Me.Form, Me.Text_TeacherEmail.BorderColor) = True Then
        MsgBox "You must complete the form before saving."
        Exit Sub
    End If
    
    
    
    
    Call saveUpdate(BookingID, TeacherID)
    
    
    DoCmd.Close acForm, Me.Form.Name, acSaveNo
    
    
    End Sub
    however the code is not exiting - it continues on to the "Call saveUpdate()" function which means runs through it when I don't want it to..????????

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,642
    I've never seen it fail. Are you sure code gets there? Do you get a message box?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Compress On Exit
    By Derrick T. Davidson in forum Access
    Replies: 5
    Last Post: 07-31-2014, 09:40 PM
  2. Exit forms without saving
    By sk88 in forum Access
    Replies: 19
    Last Post: 12-19-2013, 06:04 PM
  3. Replies: 2
    Last Post: 12-20-2012, 03:06 PM
  4. How to end/exit a sub from its nested sub?
    By lookingforK in forum Programming
    Replies: 2
    Last Post: 12-10-2012, 02:13 PM
  5. exit
    By slimjen in forum Forms
    Replies: 4
    Last Post: 10-09-2011, 09:30 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