1. ## Matrix

I have been asked to do some calculations within a data base I am working on that requires a matrix. I am trying to avoid using an excel spread sheet at this point.
Is there any one who may have the code for a matrix in VBA or know of place to start looking.

Thanks[img]/w3timages/icons/hairy.gif[/img]

2. ## Re: Matrix

Take a look at arrays!
These will probably well suited for what you want to do.

Bart

3. ## Re: Matrix

What, specifically,do you mean by a matrix? Are you trying to do lookups, or what? Essentially, any table or select query is a matric in the sense of intersecting rows and columns. In Access, in addition to, you can use custom data types with the structure you need for your data and add populated instances of that data type to a collection.

If you explain more about what you want to do, you'll get a more specific answer. You also need to indicate the version of Access you're using.

4. ## Re: Matrix: better explained

Thanks Bart and Charlotte.
I will try to be more specific about what I am looking for. The data base I work with works with keeps track of pipe that is used to move a material that contains a lot of sand and as such has a high rate of wear. We use a simple formula to create a wear rate. Medal loss/ Time on sand. The problem comes in when the engineers I work with want to be able to forecast wear using this wear rate. Actually that is not the problem. The real problem is that they wish to turn the pipe 90deg 3 or four times and forecast what the wear will be between each rotation. They tell me that it is possible using a matrix in excel which is a predefined function. From what I understand, I think it used a three dimensional array.

I am some what new to programming and agreed to give it a shot if I could find a predefined function for it in VBA so that I could walk the through the rest of the logic with the engineers.

Thanks!

5. ## Re: Matrix: better explained

It sounds like you may be talking about an Excel Pivot Table, which is actually a representation of a data cube. You can use pivot tables in Access 2000, but you have to embed them in a form or a data access page. Frankly, I'd stick with Excel for this purpose if I were you. It is better suited to playing with scenarios than Access is. Someone else may have played with Access pivot tables more and could help you out with them, if that's what you're looking for.

There is no matrix function in Excel 2000, nor was there one in Excel 97; but pivot tables were introduced in Excel 97.