Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: Variant Array IsEmpty returns False, Ubound throws an error


Message #1 by "Phillip Johnson" <phillip.johnson@e...> on Thu, 29 Aug 2002 11:53:16
Does anybody know what is happening here?  I have a variant array that is 
global in quite a large access application.  I am at a point where I need 
to check to see whether there is anything in the Array and sometimes I get 
an error.  Because its a global array it could be set anywhere and could 
be difficult for me to find what has happened to it before the error 
occurs.  

Has anybody had this problem before?  

IsEmpty returns False, which indicates that the array has been 
initialised, but Ubound throws an error, indicating that the array has not 
been initialised.  How can I tell if there is anything in the array 
without throwing an error.

Thanks in advance,

Phillip
Message #2 by JOHNWARDBELL@a... on Thu, 29 Aug 2002 09:35:01 EDT
Hi
From memory (mine) Arrays have limits to their size depending which version 
of Access your running. So...

regards johnb 

Message #3 by "Leo Scott" <leoscott@c...> on Thu, 29 Aug 2002 08:46:16 -0700
Private Function ArrayEmpty(ByVal V As Variant) As Boolean
   Dim L As Long

   ArrayEmpty = False
   On Error GoTo Err_ArrayEmpty
   L = UBound(V)

Exit Function

Err_ArrayEmpty:
   If ERR.Number = 9 Then
      ArrayEmpty = True
   Else
      MsgBox "Error number " & ERR.Number & vbCrLf & _
      ERR.Description
   End If
End Function

|-----Original Message-----
|From: Phillip Johnson [mailto:phillip.johnson@e...]
|Sent: Thursday, August 29, 2002 11:53 AM
|To: Access
|Subject: [access] Variant Array IsEmpty returns False, Ubound throws an
|error
|
|
|Does anybody know what is happening here?  I have a variant array that is
|global in quite a large access application.  I am at a point where I need
|to check to see whether there is anything in the Array and sometimes I get
|an error.  Because its a global array it could be set anywhere and could
|be difficult for me to find what has happened to it before the error
|occurs.
|
|Has anybody had this problem before?
|
|IsEmpty returns False, which indicates that the array has been
|initialised, but Ubound throws an error, indicating that the array has not
|been initialised.  How can I tell if there is anything in the array
|without throwing an error.
|
|Thanks in advance,
|
|Phillip
|


  Return to Index