Computing.Net > Forums > Programming > Simple VB question!

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Simple VB question!

Reply to Message Icon

Name: Brian
Date: December 2, 2001 at 12:10:02 Pacific
Comment:

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?



Sponsored Link
Ads by Google

Response Number 1
Name: SANDOWN Software
Date: December 2, 2001 at 12:56:39 Pacific
Reply:

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


0

Response Number 2
Name: Tom
Date: December 7, 2001 at 04:24:01 Pacific
Reply:

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


0

Response Number 3
Name: Arc
Date: December 9, 2001 at 12:48:59 Pacific
Reply:

Use the MsScript ActiveX control, just do MSScript1.Execute Text1.Text or something.

Good luck
Arc


0

Response Number 4
Name: Dk Varshney
Date: January 4, 2002 at 01:43:41 Pacific
Reply:

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


Regards



0

Response Number 5
Name: saman costa
Date: January 9, 2002 at 02:14:48 Pacific
Reply:

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 & "#"


0

Related Posts

See More



Response Number 6
Name: Dody
Date: April 16, 2002 at 04:58:33 Pacific
Reply:

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


0

Sponsored Link
Ads by Google
Reply to Message Icon

How to read bit by bit an... .EXE => .C



Post Locked

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


Go to Programming Forum Home


Sponsored links

Ads by Google


Results for: Simple VB question!

simple VB question Please Help www.computing.net/answers/programming/simple-vb-question-please-help/6021.html

simple VB question www.computing.net/answers/programming/simple-vb-question/1448.html

VB help needed please guys.... www.computing.net/answers/programming/vb-help-needed-please-guys/5275.html