i want my user to type some code in a text box at the run time. and i want the code to execute on the click event of a command button.how can i do it?thanks a lot in advance for any reply.
Printable View
i want my user to type some code in a text box at the run time. and i want the code to execute on the click event of a command button.how can i do it?thanks a lot in advance for any reply.
Vb code will be a bit hard...If it is a Sql statement, you can do easily. What exactly are you looking for?
Now, take this suggestment: do not post a question with title "Help", as it means nothing. Better to write a title related to the matter (ie, in this case:
"exec code as string" or something similar).
Best regards,
Cesare Imperiali
Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
have a look at this: it may help you.
http://codeguru.earthweb.com/cgi-bin...age=&view=&sb=
Special thanks to Lothar "the Great" Haensler. Come back soon, you Guru.
Put two textboxes and a command button on a form.
The following runs the Windows Calculator when you
type calc.exe in the first text box, don't include
any quotation marks! After you close the calculator you will see the complete string in the
second text box. I don't know if this is exactly what you are trying to do or not but you can get some ideas from it. Remember that all you have to
do to activate a command button via code is to put
"CommandButtonName_Click" or
"CommandButtonName = True"
anywhere in your project. Good Luck!
option Explicit
Dim a as string
Dim b as string
private Sub Command1_Click()
a = Text1.Text
b = "c:\windows\" + a
Text2.Text = b
Shell b
End Sub
Put two textboxes and a command button on a form.
The following runs the Windows Calculator when you
type calc.exe in the first text box, don't include
any quotation marks! After you close the calculator you will see the complete string in the
second text box. I don't know if this is exactly what you are trying to do or not but you can get some ideas from it. Remember that all you have to
do to activate a command button via code is to put
"CommandButtonName_Click" or
"CommandButtonName = True"
anywhere in your project. Good Luck!
option Explicit
Dim a as string
Dim b as string
private Sub Command1_Click()
a = Text1.Text
b = "c:\windows\" + a
Text2.Text = b
Shell b
End Sub