|
-
Jul 10th, 2009, 03:28 PM
#1
Thread Starter
New Member
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.
-
Jul 10th, 2009, 03:41 PM
#2
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
-
Jul 10th, 2009, 03:45 PM
#3
Thread Starter
New Member
Re: Script control errors in VB6
 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
-
Jul 10th, 2009, 04:00 PM
#4
Junior Member
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.
-
Jul 10th, 2009, 05:53 PM
#5
Thread Starter
New Member
Re: Script control errors in VB6
 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. 
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 '
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|