![]() ![]() Note: in this method End If is required to end the statement Use this type of method if you have multiple line of codes to be executed. The condition to be tested is: if the value of the Text1 is admin then the message box will prompt with the message Welcome admin. ![]() In the example, the if then statement will only be executed if the Command1 button will be clicked. If Text1.Text = "admin" Then MsgBox "Welcome admin" Note: in the single line method of if then statement End If is not required. YourCondition is an expression or combination of expressions (Boolean value or logical).ĬodeToExecute is the statement or code to be executed if the condition is true. There are two forms on how to write the if then statement. The if then statement check or validate if the condition is true. The if statement is the most common conditional statement used in programming, specifically in visual basic. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |