By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,587 Members | 1,079 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,587 IT Pros & Developers. It's quick & easy.

Creating array to recordset

P: n/a
Hello all,

I have 3 tables with 1 field in each. The third table has half a
million rows in it so I can do this with excel. What I want to do is
create an array that I can export to Excel. The data is as follows:

Table 1: C1, C2
Table 2: M1, M2, M3
Table 3: L1, L2, L3, L4, L5, L6

The problem is that I want each value for Table 1 on the side and each
value for Table 2 on the top as headings with Table 3 filling in the
data. There is a relationship that needs to be held. For this data,
the results I want would look like:

M1 M2 M3
C1 L1 L2 L3
C2 L4 L5 L6
I can't seem to figure this out in Access vba. Any pointers or help is
appreciated.

Dec 28 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Ok, I was able to create the array I think but now I need to do the
following. The array is 591 rows by 971 columns and null values are
not possible.

I need to find the the highest value for each column and if possible
find out what row that falls on. In the end I'd like to have a table
that is 971 records where each record is the highest number found in
that column (1 - 971) kind of like the following:

Record 1 .35 Row 482
Record 2 .56 Row 2
Record 3 .0001 Row 99
*
*
Record 971 .056 Row 311
Here is what I have so far for getting the array.-------------

Sub check()
Dim Con As Recordset
Dim lodf As Recordset
Dim mon As Recordset
Dim mystuff(591, 971) As Double
Dim c As Integer
Dim m As Integer
Dim I As Integer
Set db = CurrentDb
Set lodf = db.OpenRecordset("Ltable")
Set Con = db.OpenRecordset("Ctable")
Set mon = db.OpenRecordset("Mtable")

lodf.MoveFirst
For c = 1 To 591
For m = 1 To 971
mystuff(c, m) = lodf![LField]
lodf.MoveNext
Next m
Next c
End Sub

Dec 28 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.