InputBox
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 ElvisRun the program
and click the button.
A Message Box is appearing with the
text "Please
Enter your name"
(Figure 1).
Figure 1