arrays

  • Thread starter Thread starter n6trf
  • Start date Start date
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
 
n6trf said:
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

A properly design database never has more than one piece of data in a field
so there should be no need to ever reference the "ith element in a field".
If you need that then you should have an additional table related to the
first.
 
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?
 
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.
 
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.
 
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.
 
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]
 
OK, we're being terse.

Just set up a 1:M relationship between your existing table and the one
with the dates.
 
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
 
Back
Top