I have a word document that is created from Access which has 2 tables which
are both extendable to a number of rows dependant on nthe contents of the
query in access.

The data passes fine from Access to word, however as the first table grows
the second table over writes the last rows of the first.

Is there a way that I can use VBA (Called in Access) to move the position of
the second table to avoid overrighting of the last rows in the first table.

--
Many Thanks for your time

Alan

Re: Move Position of Table using VBA by Cindy

Cindy
Thu Jun 19 02:39:21 PDT 2008

Hi Alan,

> I have a word document that is created from Access which has 2 tables which
> are both extendable to a number of rows dependant on nthe contents of the
> query in access.
>
> The data passes fine from Access to word, however as the first table grows
> the second table over writes the last rows of the first.
>
> Is there a way that I can use VBA (Called in Access) to move the position of
> the second table to avoid overrighting of the last rows in the first table.
>
By "overwrites" do you mean replaces, or superimposes?

Could you please show us the code that creates and writes to the tables, and
tell us the version of Word involved?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)


Re: Move Position of Table using VBA by Alan

Alan
Thu Jun 19 02:54:00 PDT 2008

Cindy

Sorry - Super imposes itself over the first table

The code from access simply references docVariables within the tables loops
through all entries and creates a carriage return which extends the tables
size.

In an access for I can work this out using a simple row count function that
lets me evaluate the .top of the next subform and extand the main form
accordingly

If I can use a similar mechanism to update the top of the second table then
I can move it further down the page to avoid the end of the first

I hope this makes sense
The Access code is quite lengthy but I will post if if your require further
clarification

--
Many Thanks Again

Alan


"Cindy M." wrote:

> Hi Alan,
>
> > I have a word document that is created from Access which has 2 tables which
> > are both extendable to a number of rows dependant on nthe contents of the
> > query in access.
> >
> > The data passes fine from Access to word, however as the first table grows
> > the second table over writes the last rows of the first.
> >
> > Is there a way that I can use VBA (Called in Access) to move the position of
> > the second table to avoid overrighting of the last rows in the first table.
> >
> By "overwrites" do you mean replaces, or superimposes?
>
> Could you please show us the code that creates and writes to the tables, and
> tell us the version of Word involved?
>
> Cindy Meister
> INTER-Solutions, Switzerland
> http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
> http://www.word.mvps.org
>
> This reply is posted in the Newsgroup; please post any follow question or reply
> in the newsgroup and not by e-mail :-)
>
>

Re: Move Position of Table using VBA by Cindy

Cindy
Fri Jun 20 01:05:32 PDT 2008

Hi =?Utf-8?B?QWxhbg==?=,

> I hope this makes sense
>
It's not telling me what I want to know (what I suspect is
happening). You also don't give us any information about
the version of Word involved.

What I'm really interested in is the Tables.Add method (the
parameters used) and any formatting you do to the Table
(positioning kind of stuff).

The behavior you describe really should only be possible if
the table has been formatted with a "text flow" (like
around a graphic). But I find that so unlikely with tables
being created by code...

By default, the tables will *not* have this capability and
one will "push" the other down the page automatically.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:-)


Re: Move Position of Table using VBA by Alan

Alan
Fri Jun 20 04:45:00 PDT 2008

Cindy

Sorry I dont mean to be obtuse and I am by no means an expert with Office or
VBA

I am using office suite 2003
I have created a word template which contains 2 tables.
Both of these are referenced from access to the template and updated using
the VBA

objWord.Documents(1).Variables("varDept") etc


Both tables grow as I loop through the entires in the Access query and enter
a carriage return to provide a paragraph/list type value to be entered as the
variable
viz:
strDept = strDept & .Fields("Department") & Chr$(11)

This presents in the table the way I want it to, but the first table does
not "push" the second table down automatically as I thought it would

I hav no formatting in my code and do not use the Tables.Add method you
describe, but clearly there is another option

I hope this clarifies where I am at and I am very much obliged for any
assistance you can provide
--
Many Thanks

Alan


"Cindy M." wrote:

> Hi =?Utf-8?B?QWxhbg==?=,
>
> > I hope this makes sense
> >
> It's not telling me what I want to know (what I suspect is
> happening). You also don't give us any information about
> the version of Word involved.
>
> What I'm really interested in is the Tables.Add method (the
> parameters used) and any formatting you do to the Table
> (positioning kind of stuff).
>
> The behavior you describe really should only be possible if
> the table has been formatted with a "text flow" (like
> around a graphic). But I find that so unlikely with tables
> being created by code...
>
> By default, the tables will *not* have this capability and
> one will "push" the other down the page automatically.
>
> Cindy Meister
> INTER-Solutions, Switzerland
> http://homepage.swissonline.ch/cindymeister (last update
> Jun 17 2005)
> http://www.word.mvps.org
>
> This reply is posted in the Newsgroup; please post any
> follow question or reply in the newsgroup and not by e-mail
> :-)
>
>

Re: Move Position of Table using VBA by Cindy

Cindy
Sat Jun 21 08:35:20 PDT 2008

Hi =?Utf-8?B?QWxhbg==?=,

> I have created a word template which contains 2 tables...
> I hav no formatting in my code and do not use the Tables.Add method you
> describe, but clearly there is another option
>
Aha. OK. Click in the first table, go to Table/Table Properties and look in the
Table tab of the dialog box. Make sure "Text wrapping" is set to "None".

Repeat for the second table.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)


Re: Move Position of Table using VBA by Alan

Alan
Mon Jun 23 04:20:00 PDT 2008

Cindy

Many Thanks - I will learn to be more explicit
Easy when you know how !!
--
Many Thanks

Alan


"Cindy M." wrote:

> Hi =?Utf-8?B?QWxhbg==?=,
>
> > I have created a word template which contains 2 tables...
> > I hav no formatting in my code and do not use the Tables.Add method you
> > describe, but clearly there is another option
> >
> Aha. OK. Click in the first table, go to Table/Table Properties and look in the
> Table tab of the dialog box. Make sure "Text wrapping" is set to "None".
>
> Repeat for the second table.
>
> Cindy Meister
> INTER-Solutions, Switzerland
> http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
> http://www.word.mvps.org
>
> This reply is posted in the Newsgroup; please post any follow question or reply
> in the newsgroup and not by e-mail :-)
>
>