arrays

N

n6trf

Am I missing something. Does access handle arrays of a field? Or do I mean
arrays in a field. I would like to reference the ith element in a field.
Code written in basic. TIA
 
J

John Nurick

You'll have to explain more clearly what you're thinking of, and
preferably give an example. Do you mean:

- storing the contents of a VBA array in a database field?
- parsing substrings out of a text field?
- constructing an array or collection containing the contents of the ith
field of each record in a recordset?
- something else?
 
N

n6trf

John Nurick said:
You'll have to explain more clearly what you're thinking of, and
preferably give an example. Do you mean:

- storing the contents of a VBA array in a database field?

Have a vba array of dates some with data. Storing that array in a field &
then having a report that prints the array should solve my problem.
 
J

John Nurick

Have a vba array of dates some with data. Storing that array in a field &
then having a report that prints the array should solve my problem.

As Rick says, in this situation it's usually best to avoid storing
multiple values in a single field. Instead, store the related data in a
separate table.
 
K

Klatuu

That will not ever happen in a field and the report would never understand
it. What you need is a table. You need one record in the table for each
group of related data. You need one field for each item in the group.

n6trf said:
John Nurick said:
You'll have to explain more clearly what you're thinking of, and
preferably give an example. Do you mean:

- storing the contents of a VBA array in a database field?

Have a vba array of dates some with data. Storing that array in a field &
then having a report that prints the array should solve my problem.
 
J

John Vinson

All,


Wait... Did I read this right?

http://www.microsoft.com/office/preview/programs/access/top10.mspx

See #10 of Top 10 Benefit of Access 2007

Yes. Access 2007 (but not earlier versions) supports "multiple value
fields".

The discussion between the MVP's and the Access development team at
the last Summit, where this was introduced, was... well, let's stay
under NDA and just call it "interesting".

The multiple values are actually stored in a (concealed) many-to-many
normalized table.

John W. Vinson[MVP]
 
N

n6trf

since each record has a unique array of dates how does one connect a table
to a field?
 
J

John Nurick

OK, we're being terse.

Just set up a 1:M relationship between your existing table and the one
with the dates.
 
I

Immanuel Sibero

Thanks John,
The multiple values are actually stored in a (concealed) many-to-many
normalized table.

Nice! Think of the possibilities... multiple value lookup field!


Immanuel Sibero
 
Top