Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / December 2005

Tip: Looking for answers? Try searching our database.

Size of array elements?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Margaret Bartley - 28 Dec 2005 20:57 GMT
I have a two-dimensional array that I redim in my code:

   ReDim arRecs(FCnt, 8)

This gives me 8 data elements for every Farm (FCnt).  There are many
different types of data in this array; I'm having trouble with the string
elements.

Each element is truncated at 50 characters.  Is there a way to force this
array to give me 255 characters for each element that gets used as a string?
John Nurick - 28 Dec 2005 22:45 GMT
Hi Margaret,

Assuming you've declared arRecs as an array of variant, e.g.

    Dim arRecs() As Array

there seems no obvious reason why you shouldn't be able to store as much
as you like in the strings (subject of course to the usual limitations
such as available virtual memory). Is it possible that you're retrieving
strings from 50-character text fields?

But a two-dimensional array is probably not the best place to store
structured data in VBA, and still less in Access, where the first choice
is normally to store data in a table.

If you want to get all the data into memory, you could define a custom
type to hold the fields you need, e.g.

    Type tFarm
     Name As String
     County As String
     Area As Single
     ...
    End Type

and then have an array of tFarm. Or better yet, define a Farm class and
construct a Collection of Farm objects.

>I have a two-dimensional array that I redim in my code:
>
[quoted text clipped - 6 lines]
>Each element is truncated at 50 characters.  Is there a way to force this
>array to give me 255 characters for each element that gets used as a string?

--
John Nurick [Microsoft Access MVP]

Please respond in the newgroup and not by email.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.