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 / New Users / May 2005

Tip: Looking for answers? Try searching our database.

Need help deperatly, fill array

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
TheGerman - 20 May 2005 14:30 GMT
Hello,

I hope somone can help me solve this problem!

I need to fill an array with Data from a Report!

For i = 1 To Report_UpdateReport.Count

myarray(i) = ?

 Next i

How do i fill the array with the information?  People suggest me to use the
.EOF command but access dosn't seem to find that command.
I would highly appriciate it if you could help me fill this array.  The
field in my report i want is called "parentid" and the reports anme is
UpdateReport

Thank you very much!

~Daniel
John Nurick - 20 May 2005 21:18 GMT
Hi Daniel,

You probably need to work with the query or table that is the report's
data source, not with the report itself. Then one way to proceed is with
something like this air code:

 Dim rstR As DAO.Recordset
 Dim arRows As Variant
 
 'Open Recordset
 Set rstR = CurrentDb.OpenRecordset _
   ("SELECT ParentID FROM MyQueryOrTable;")

 rstR.MoveLast   'do this to ensure correct RecordCount
 rstR.MoveFirst
 arRows = rstR.GetRows(rstR.RecordCount)

GetRows() provides a two-dimensional array, with the first index
representing fields and the second records. Hence to access the first
(and in this example only) field in the third record you would use

    arRows(0, 2)

If you must have a one-dimensional array you will need to iterate
through the recordset using MoveNext, and assigning the field value to
the appropriate array element.

>Hello,
>
[quoted text clipped - 17 lines]
>
>~Daniel

--
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.