Lesson4 (4/22)

Input

In the next examples we want to receive a value from the user when the program is running.
To do so we will use the InputBox command.The InputBox command syntax is:

VariableName = InputBox ("Text to Display")

After executing this command, the variable will get the value that the user has entered.
Example:
Put 1 Command button on your form and enter the following code to its click event:

Dim Elvis As String
Elvis = InputBox("Please Enter your name")
Print Elvis


Run the program and click the button. A Message Box is appearing with the
text "Please Enter your name" (Figure 1).

Type your name in the text box, and press OK.Your name will be printed on the form.