Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I have a textbox and a command button on a form. I need to make it so that the user can input his own VB code in the textbox, and then have it execute on the command1_click event. How would i accomplish this?

This is impossible.
no keys----------------
If there are specific commands you want to execute, make a small text parser (using string functions) that reads the text out of the text box, but limit it to only the functions you want. For example:Private Sub Command1_Click()
Dim theText As String
theText = Text1.Text
If Left(theText, 7) = "DoClose" Then
Unload Me
End If
End Sub

Hi Brian
I'm not sure that this is impossible. Its just that it may be a VERY convoluted solution - and I don't know all of it.
You can get the macro to export a text file as a ".bas" which, when reloaded into VB, executes the commands entered.
The bit I can't fudge is getting VB to open and execute another VB script file. There is very likely a way of doing this - even if you have to resort to "sendkeys" - but this may suffer a little from "reliability issues" (groan).
Others here may be able to finish off this train of thought for me...?
Good Luck
Tom

I want to know that how can we add the crystal reports option in porject/more activex desginer menu og visual basic
Regards

my vb sql is here when i try to Query to date , record count is zero when i check access db equal records avalable please help me
With rs
.ActiveConnection = Cn
.CursorType = adOpenStatic
.CursorLocation = adUseServer
.LockType = adLockReadOnly
.Open "SELECT * FROM Acc_Bank_Balance WHERE bank_code = '" & bankcd & "' " & _
" AND bal_date LIKE #" & DTPicker1.Value & "#"

ther is an error 'unable to bind.....blablabla....' when i load a Form with dtpicker on the form how can i solve this problem

![]() |
How to read bit by bit an...
|
.EXE => .C
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |