compile error "invalid procedure call or argument 
Author Message
 compile error "invalid procedure call or argument

I try to set the focus in the text field, but it has the
compile error "invalid procedure call or argument." Any ideas??

Sub Form_Load
 txtUserID.setFocus
End Sub

If I put this  *txtUserID.setFocus* in different functions, it seems working
fine.



Tue, 18 Oct 2005 09:50:19 GMT  
 compile error "invalid procedure call or argument
Try placing the code in the Form_Activate event.

Chuck Heinzelman


Quote:
> I try to set the focus in the text field, but it has the
> compile error "invalid procedure call or argument." Any ideas??

> Sub Form_Load
>  txtUserID.setFocus
> End Sub

> If I put this  *txtUserID.setFocus* in different functions, it seems
working
> fine.



Tue, 18 Oct 2005 11:08:02 GMT  
 compile error "invalid procedure call or argument
Hello,


Quote:
> I try to set the focus in the text field, but it has the
> compile error "invalid procedure call or argument." Any ideas??

You must show the form before setting the focus to a control:

\\\
Private Sub Form_Load()
    Call Me.Show
    Call Me.Text2.SetFocus
End Sub
///

Regards,
Herfried K. Wagner



Tue, 18 Oct 2005 12:14:25 GMT  
 compile error "invalid procedure call or argument


Quote:
> I try to set the focus in the text field, but it has the
> compile error "invalid procedure call or argument." Any
ideas??

> Sub Form_Load
>  txtUserID.setFocus
> End Sub

A safer SetFocus is like:

If txtUserID.Visible And txtUserID.Enabled Then
  txtUserID.SetFocus
End If



Tue, 18 Oct 2005 12:42:16 GMT  
 compile error "invalid procedure call or argument
The control isn't visible (in fact not completely instantiated) until the form
is loaded, ie after the Form_load() has completed


Quote:
> I try to set the focus in the text field, but it has the
> compile error "invalid procedure call or argument." Any ideas??

> Sub Form_Load
>  txtUserID.setFocus
> End Sub

> If I put this  *txtUserID.setFocus* in different functions, it seems working
> fine.



Tue, 18 Oct 2005 17:22:20 GMT  
 compile error "invalid procedure call or argument

Quote:
> I try to set the focus in the text field, but it has the
> compile error "invalid procedure call or argument." Any ideas??

> Sub Form_Load
>  txtUserID.setFocus
> End Sub

> If I put this  *txtUserID.setFocus* in different functions, it
> seems working fine.

There is no setfocus method in VB.Net.

--
Armin



Tue, 18 Oct 2005 19:34:10 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. compile error "invalid procedure call or argument

2. Error 5 Invalid Procedure call or argument

3. Run-time error '5': Invalid procedure call or argument

4. Run-time error '5': Invalid procedure call or argument

5. Function Error: Invalid procedure call or argument

6. Navigate2 causes Invalid procedure call or argument error (#5)

7. Error 5: Invalid procedure call or argument

8. Run-time error "5": Invalid procedure call

9. "Invalid Argument" Error Message

10. ERROR 3001 - "Invalid Argument"

11. "Invalid Argument" errors

12. Invalid procedure call or argument on Dir functioon

 

 
Powered by phpBB® Forum Software