|
-
Jun 16th, 2006, 05:57 AM
#1
Thread Starter
Frenzied Member
Invalid procedure call or argument.
Hi, why does the .SetFocus method raise the following error :
Invalid procedure call or argument.
VB Code:
Private Sub Timer3_Timer()
Me.text4.Enabled = True
Me.text4.SetFocus
Me.Timer3.Enabled = False
End Sub
tia
Regards
Jorge
"The dark side clouds everything. Impossible to see the future is."
-
Jun 16th, 2006, 06:02 AM
#2
Fanatic Member
Re: Invalid procedure call or argument.
Is the form that this code is in visible? If it isn't then that is what is causing the error
-
Jun 16th, 2006, 08:57 AM
#3
Thread Starter
Frenzied Member
Re: Invalid procedure call or argument.
"The dark side clouds everything. Impossible to see the future is."
-
Jun 16th, 2006, 09:01 AM
#4
Re: Invalid procedure call or argument.
And is the Text4 textbox on any Frame or Picture box which itself is disabled?
Use [code] source code here[/code] tags when you post source code.
My Articles
-
Jun 16th, 2006, 09:04 AM
#5
Thread Starter
Frenzied Member
Re: Invalid procedure call or argument.
Yes its on a enabled and visible frame.
Jorge
"The dark side clouds everything. Impossible to see the future is."
-
Jun 16th, 2006, 09:12 AM
#6
Re: Invalid procedure call or argument.
 Originally Posted by Asgorath
Hi, why does the .SetFocus method raise the following error :
Invalid procedure call or argument.
VB Code:
Private Sub Timer3_Timer()
Me.text4.Enabled = True
Me.text4.SetFocus
Me.Timer3.Enabled = False
End Sub
tia
Regards
Jorge
I just tried your code and it works fine for me. What line is highlighted when the error occurs?
-
Jun 16th, 2006, 09:12 AM
#7
Re: Invalid procedure call or argument.
Can you try this code and let us know what it does?
VB Code:
Private Sub Timer3_Timer()
Me.text4.Enabled = True
If Not Me.text4.Container.Enabled Then
Debug.Print "SetFocus Cannot be used"
Else
Me.text4.SetFocus
End If
Me.Timer3.Enabled = False
End Sub
Use [code] source code here[/code] tags when you post source code.
My Articles
-
Jun 16th, 2006, 09:16 AM
#8
Re: Invalid procedure call or argument.
 Originally Posted by Hack
I just tried your code and it works fine for me. What line is highlighted when the error occurs?
I just disabled the frame, ran the code, and got the Invalid procedure error.
Somewhere along the line, your frame is being disabled.
-
Jun 16th, 2006, 09:53 AM
#9
Thread Starter
Frenzied Member
Re: Invalid procedure call or argument.
Hi, i've modified to code to this and i still the invalid error.
VB Code:
Private Sub Timer3_Timer()
Me.Visible = True
Me.text4.Visible = True
Me.text4.Enabled = True
Me.Frame1.Enabled = True
Me.Frame1.Visible = True
MsgBox Me.text4.Container.Name
If Me.text4.Container.Enabled Then
MsgBox "enabled"
Else
MsgBox "disabled"
End If
Me.text4.SetFocus
Me.Timer3.Enabled = False
End Sub
Jorge
"The dark side clouds everything. Impossible to see the future is."
-
Jun 16th, 2006, 10:21 AM
#10
Re: Invalid procedure call or argument.
What is the Timer Interval? When is this code executing? At Form Load?
-
Jun 16th, 2006, 10:22 AM
#11
Thread Starter
Frenzied Member
Re: Invalid procedure call or argument.
I erased the frame and moved the textboxes to the form and i still get the warning that the container is disabled.
Jorge
"The dark side clouds everything. Impossible to see the future is."
-
Jun 16th, 2006, 10:24 AM
#12
Thread Starter
Frenzied Member
Re: Invalid procedure call or argument.
 Originally Posted by brucevde
What is the Timer Interval? When is this code executing? At Form Load?
The timer is fired only once from another from. Interval 1.
Jorge
"The dark side clouds everything. Impossible to see the future is."
-
Jun 16th, 2006, 10:35 AM
#13
Re: Invalid procedure call or argument.
VB Code:
I erased the frame and moved the textboxes to the form and i still get the warning that the container is disabled.
Seems like the Form is not enabled then...
-
Jun 16th, 2006, 10:47 AM
#14
Thread Starter
Frenzied Member
Re: Invalid procedure call or argument.
But i've got form.enabled = true just before the setfocus.
Jorge
"The dark side clouds everything. Impossible to see the future is."
-
Jun 16th, 2006, 10:49 AM
#15
Re: Invalid procedure call or argument.
zip up your project and attach it here
-
Jun 16th, 2006, 10:49 AM
#16
Re: Invalid procedure call or argument.
VB Code:
But i've got form.enabled = true just before the setfocus.
Not according to the posted code.
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
|