Al
Fri Oct 10 22:24:00 CDT 2003
Hi Jean-Guy & Doug,
Yes it does actually have 10, but not all ten are used at this stage, though
they are later.
I see in both your example and Doug's example that the data is inserted one
piece at a time.
I am sur eyou guys have seen it, but if you have'nt have a look at;
http://www.mvps.org/word/FAQs/TblsFldsFms/FastTables.htm
point number 5 in particular, and 8 and 10.
Does that relate to this scenario?
-Al
The MVP site I read on tables
"JGM" <no-spam@leaveme.alone> wrote in message
news:eb7vf74jDHA.2444@TK2MSFTNGP09.phx.gbl...
> Hi Al,
>
> Your array, if I remember correctly had 10 rows and as many column as
there
> were people.
> If in the end you are using only 6 data type per person, then you do not
> need to put 10 coloumns everything in the array.
>
> In any case, you should have something like: MyArray(5 , x) were x =
number
> of people.
>
> You use that array to populate the combobox. Then the user used the
combobox
> to confirm that everything is OK (I strongly recommend that you give the
> user a way of reviewing, adding, modifying, deleting names). Once
everything
> has been confirmed, your array is ready to go.
>
> You can use the array, not only the combobox, to populate your table.
>
> Find the logic of your table and combine it to your array. You are going
to
> have to figure out the logic behind inserting the text in the appropriate
> places.
>
> Prepare an Autotext that has all the rows/cells neccessary for one person,
> then, before inserting the text, insert as many Autotext as you have
people,
> then either place the cursor, or use the range object to define the table
> you need for the job.
>
> For example:
>
> With MyRange.Tables(1)
>
> For r = 0 To UBound(MyArray, 2) 'Look for UBound in the Help
> .Cell((r * 4) + 1, 2).Range.Text = MyArray(0 , r)
> .Cell((r * 4) + 1, 4).Range.Text = MyArray(1 , r)
> .Cell((r * 4) + 2, 2).Range.Text = MyArray(2 , r)
> .Cell((r * 4) + 2, 4).Range.Text = MyArray(3 , r)
> .Cell((r * 4) + 3, 2).Range.Text = MyArray(4 , r)
> 'etc.
> Next r
>
> End With
>
> Or something like that...
>
> HTH
> Cheers.
> --
> _______________________________________
> Jean-Guy Marcil
> jmarcil@sympatico.ca
>
> "Al & Cay Grant" <bigal_nz@no$spam.remove.hotmail.com> a écrit dans le
> message de news: bm7cj1$8rr$1@lust.ihug.co.nz...
> > Jean-Guy and Jonathon know the background to this question, so if your
> > reading this guys I would love to hear your thoughts.
> >
> > I have a series of listboxes which ask for;
> > Name, Address, Town, DOB, Age, Job.
> >
> > This is then saved as an array, which is used to populate a list box
with
> > the above information.
> >
> > Each ROW in the listbox represents a person, but because of Redim
Preserve
> > affecting only the columns each COLUMN of the array is a person. They
are
> > transposed between the listbox and the array.....
> >
> > I am at the stage now where I am inserting the personal info into a
table
> in
> > a template.
> >
> > The table is the first table in the template and is 4 x 4. If their is
> more
> > than one person additional tables (which contain formatting) are
inserted
> by
> > way of a autotext entry.
> >
> > Now I could insert each bit of personal information bit by bit with
> > something like:
> >
> > For r = 0 To numberinlistbox
> > .Tables(1).Cell((r * 4) + 1, 2).Range.Text = ListBox2.List(r, 0) '
Insert
> > Full Name
> > Next r
> >
> > But that is gonna mean 6 loops, that loop for each person, and typically
> > talking about 2-3 people, and is rather ugly way to do it.
> >
> > I have read on a MVP website that its better to insert as much data as
> > possible at once, and that to do it, peice by peice is very slow.
> >
> > Anybody know a way to do this quicker?
> >
> > The end result should look like:
> >
> > Name1 DOB: 12/12/80
> > Address1 AGE: 23
> > Town1 OCC: Builder
> >
> > Where DOB/AGE/OCC are in the autotext table.....
> > <