R
RayC
Is it possible to execute a String? e.g. if I type in something like
"TextBox1.Visible = True",
the code executes that line and makes the TextBox1 Visible. What I am asking
is would it be possible to have strString1 ="TextBox1" and strString2 =
"Visible" then concatenate the two strings into strExecute = str1 & "." &
strString2 to leave strExecute = "Textbox1.Visible".
Whilst .Visible is probably not the best example but if there was a way to
execute that string, I could then have a very flexible Sub routine where I
could pass the required arguments to it and have the routine do some very
mundane work.
e.g.
Call util_Clearform(Forms.form1, Visible, False)
Public Sub util_ClearForm(frm As Form, Opps as String. Stat As Boolean)
Dim Cntrl As Control
For Each Cntrl In frm
' this is the bit I am enquiring about
Then Cntrl.Enabled = Stat
Next Cntrl
End Sub
Is there ant way I could execute something like
Then cntrl & "." & opps = Stat
If you understand what I am saying
Thaks RayC
"TextBox1.Visible = True",
the code executes that line and makes the TextBox1 Visible. What I am asking
is would it be possible to have strString1 ="TextBox1" and strString2 =
"Visible" then concatenate the two strings into strExecute = str1 & "." &
strString2 to leave strExecute = "Textbox1.Visible".
Whilst .Visible is probably not the best example but if there was a way to
execute that string, I could then have a very flexible Sub routine where I
could pass the required arguments to it and have the routine do some very
mundane work.
e.g.
Call util_Clearform(Forms.form1, Visible, False)
Public Sub util_ClearForm(frm As Form, Opps as String. Stat As Boolean)
Dim Cntrl As Control
For Each Cntrl In frm
' this is the bit I am enquiring about
Then Cntrl.Enabled = Stat
Next Cntrl
End Sub
Is there ant way I could execute something like
Then cntrl & "." & opps = Stat
If you understand what I am saying
Thaks RayC