-
How can i execute a command which is stored in a varible?
an example is making a program that the user can write commands in a textbox and the computer will execute them.
(i am not making this program but i'm using it as an example. it wouldn't be a good program anyway)
could somebody help me please?
-
well, obviously you will have to decide on some syntactical structure and then use the Left$() Mid$() etc... functions to extract the info. Its dead easy really if you write the code in a coherent fashion.
-
That's a big one.
easier if you use option buttons.
ie. opt 1 Close This Form Open Form Two
opt 2 Close Form Two Open Form One
Option Explicit
Public OptionBtn as String
Select Case OptionBtn
Case "1"
Call Close1
Case "2"
Call Close2
End Select
Public Sub Close1
frmOne.visible = false
frmTwo.visible = true
End Sub
Public Sub Close2
frmTwo.visible = false
frmOne.visible = true
End Sub
Private Sub cmdPerformTask_Click
If Form1.opt1.Value = True Then OptionBtn = "1"
If Form1.opt2.Value = True Then OptionBtn = "2"
End Sub