Script control errors in VB6
Hi,
I have a VB6 form with the following
Textbox (Text1)
Microsoft Script Control v1.0 (scCTRL)
command1 button
The command button has the code
Private Sub Command1_Click()
FldName = "Text1"
scCTRL.ExecuteStatement FldName & ".Enabled = False"
End Sub
When it runs I get the following error
Object Required : 'Text1'
Any ideas ??
Regards
Karl.
Re: Script control errors in VB6
Not familiar with the script control; never used it. But for what you are doing, you don't need it.
Me.Controls(fldName).Enabled = False
Re: Script control errors in VB6
Quote:
Originally Posted by
LaVolpe
Not familiar with the script control; never used it. But for what you are doing, you don't need it.
Me.Controls(fldName).Enabled = False
Wow - that was a quick reply.
What about if the field is indexed i.e Text1(0)
Cheers
Re: Script control errors in VB6
Don't need it as LaVolpe said, but I think you need to call: ScriptObject.AddObject Text1
But:
vb Code:
Me.Controls("Text1")(0).Enabled = False
should work. :cool:
Re: Script control errors in VB6
Quote:
Originally Posted by
vbpHacker
Don't need it as LaVolpe said, but I think you need to call: ScriptObject.AddObject Text1
But:
vb Code:
Me.Controls("Text1")(0).Enabled = False
should work. :cool:
Great ! - Me.Controls("Text1")(0).Enabled = False works as expected.
With regards the line you mentioned for the script control component..
ScriptObject.AddObject Text1
Regards
Karl
It throws an error message
'Argument not optional '