Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Exit Sub

hofadommahofadomma Member Posts: 28
What else can you use in a If, then statment that will act like End Sub

Example,,

my program goes If checkbox=1 then
(I want it to stop here but exit sub is not working)
Else
Copy SrcFile,Destination

I don't want the program to stop, just skip the sub, any suggestions?

Comments

  • DarQDarQ Member Posts: 1,625
    exit sub doesnt work??? What error do you get? ??? Is it a sub? If its a function you must do exit function ofcourse.


    : What else can you use in a If, then statment that will act like End Sub
    :
    : Example,,
    :
    : my program goes If checkbox=1 then
    : (I want it to stop here but exit sub is not working)
    : Else
    : Copy SrcFile,Destination
    :
    : I don't want the program to stop, just skip the sub, any suggestions?
    :



    Greetz from DarQ

    --- Be sure to check ---
    http://www.aidix.cjb.net
    For info about AI stuff in VB

  • tburchamtburcham Member Posts: 102
    Hi,
    Are you sure you didn't accidentally put "End Sub"
    intstead?

    This code worked for me: [code]
    Private Sub Check1_Click()
    If Check1 = 1 Then Exit Sub
    A = B
    End Sub
    [/code]

  • hofadommahofadomma Member Posts: 28
    : Hi,
    : Are you sure you didn't accidentally put "End Sub"
    : intstead?
    :
    : This code worked for me: [code]
    : Private Sub Check1_Click()
    : If Check1 = 1 Then Exit Sub
    : A = B
    : End Sub
    : [/code]
    :
    :
    Yup, that's what I did, thanks guys, dumb mistake.....
  • Andre YoungAndre Young USAMember Posts: 0

    ________ [ http://forcoder.org ] free video tutorials and ebooks about \ Objective-C, Scratch, JavaScript, Go, C#, Visual Basic .NET, Swift, Assembly, Python, C++, R, Java, PHP, Perl, Visual Basic, C, Delphi, MATLAB, Ruby, PL/SQL Alice, LabVIEW, FoxPro, Apex, D, Crystal, ML, Logo, Kotlin, Erlang, Ada, Julia, Scala, COBOL, Clojure, VBScript, Scheme, F#, Lisp, Dart, Fortran, Hack, Prolog, Rust, Transact-SQL, ABAP, SAS, Awk, Lua, Bash \ _____________

Sign In or Register to comment.