how to loop a form without the msgBox

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • yoda
    Contributor
    • Dec 2006
    • 291

    #1

    how to loop a form without the msgBox

    Sorry Ben3eeE about that i'm not very good at programming and i'm in high school

    I just want to know how to loop a form without the message box.
  • Dököll
    Recognized Expert Top Contributor
    • Nov 2006
    • 2379

    #2
    I would suggest leaving the message box there until you are sure form elements work fine. Your message box can be saviour, depending of course if you have only one. You can end it, if you have and if statement for example, as:

    Code:
    If Label1.Caption = "Red" Then
    Text1.Text = "GoogooGaga"
    
    ElseIf Label2.Caption = "Blue" Then
    Text2.Text = "Yahoowee"
    
    ElseIf Label3.Caption = "Yellow" Then
    Text3.Text = "Oh la la"
    
    Else
    
    MsgBox "Something went wrong here!"
    
    End If
    So, your MsgBox helps grab an error, if in fact, you're supposed to find Red, Blue, and/or Yellow; if either is not found, you should know.

    Now once that's settled, remove:

    Code:
    Else
    
    MsgBox "Something went wrong here!"
    
    and simply close your If statement, thus [B]End If[/B]
    You will free yourself from getting stuck in a loop. Please write if this doeas not make sense or you require additional information. Perhaps you will find help in case I do not see your reply.

    Good luck!

    Dököll

    Comment

    Working...