Rocky Smolin at Beach Access Software
rockysmolin at bchacc.com
Mon Mar 17 10:31:54 CDT 2008
Gustav: I modified the code to: If lngDeletes <> 0 Then Dim lngTemp As Long lngTemp = UBound(mudTH) - lngDeletes 'ReDim Preserve mudTH(1 To UBound(mudTH) - lngDeletes) ReDim Preserve mudTH(1 To lngTemp) End If But got the locked error anyway. Could it have soething to do with the fact that the array is DIMmed as THRecord where THRecord is a Type? TIA Rocky -----Original Message----- From: accessd-bounces at databaseadvisors.com [mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Gustav Brock Sent: Monday, March 17, 2008 8:20 AM To: accessd at databaseadvisors.com Subject: Re: [AccessD] Array is locked Hi Rocky If ReDim Preserve mudTH(1 To 1) works, I would first calculate UBound(mudTH) - lngDeletes in a variable and then use that. /gustav >>> rockysmolin at bchacc.com 17-03-2008 16:09 >>> Dear List: I am getting an error 10 - This array is fixed or temporarily locked - when executing: ReDim Preserve mudTH(1 To UBound(mudTH) - lngDeletes) where Ubound(mudTH) = 41 and lngDeletes = 40. The conditions which would cause this as listed in the Help do not seem to apply in this case. Access, being what it is, the error may not be exactly descriptive. Does anyone know of other reasons why you might get this error on a ReDim Preserve? MTIA Rocky -- AccessD mailing list AccessD at databaseadvisors.com http://databaseadvisors.com/mailman/listinfo/accessd Website: http://www.databaseadvisors.com No virus found in this incoming message. Checked by AVG. Version: 7.5.519 / Virus Database: 269.21.7/1331 - Release Date: 3/16/2008 10:34 AM