HouseDad [mailto:[EMAIL PROTECTED] wrote:
> 
> I have a data entry program that is basically the same 
> program I use for these jobs, except the fields have changed.
> 
> The program runs fine in studio (ie. F5), but when compiled, 
> I get an error 5, invalid procedure call or argument.
> 
> How can I trouble shoot this?  I can't find where the error 
> is occuring since it doesn't happen in studio, and the 
> compiled program just exists after the error is displayed.
> 
> Is there a common cause for this type of thing?

When I've had this problem, it's most often been due to calling "SetFocus"
(or some other operation) on a control during the form's load event.  If
this is the cause of the problem, it can be fixed by moving the problem code
to the form's "Activate" event handler, and using a static variable or
member variable to ensure that the SetFocus only occurs the first time the
form becomes active.

Private Sub MyForm_Activate()
  Static bActivated As Boolean

  If Not bActivated Then
    bActivated = True
    'Do something here that is supposed to happen only once when the form is
first loaded.
  End If
End Sub


Adelle.



------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/k7folB/TM
--------------------------------------------------------------------~-> 


'// =======================================================
    Rules : http://ReliableAnswers.com/List/Rules.asp
    Home  : http://groups.yahoo.com/group/vbHelp/
    =======================================================
    Post  : [EMAIL PROTECTED]
    Join  : [EMAIL PROTECTED]
    Leave : [EMAIL PROTECTED]
'// =======================================================
 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/vbhelp/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to