Generating Footer

C

Chris

Hi Group,

From access I am generating standard letters (word documents). When the
letter is opened I would like to alter the footer depending on a specific
value in the database.

IF Value = a Then
document.footnote = "Some Text"
Else
document.footnote = "Hello World"
End If

I don't know if I am better to do this in a macro from Word.

Could someone please advise?
Thanks
 
D

Doug Robbins - Word MVP

IMHO, it is better to manipulate data in a database rather than a word
processor.

Therefore, I would use and IIF function in a query in Access to text the
value in the field and return the appropriate text.

If can also be done with an If...then...Else field construction in Word, but
it will then probably be necessary to update the fields in the footer to get
the appropriate text to be displayed.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
C

Chris

Hi Doug,

Sorry if my post wasn't clear. I don't want to input data via the Word
document, The word document is going to be a letter. When the database is
run the bookmarks are populated, at which point I would like the footer to
be determined by the value of who has created the letter.i.e. IF the
bookmark on the letter for 'Name' = John Then Footer = Johns Details

I don't know how to alter the footer through VBA in access so thought I'd
try a macro in Word however if you could point me in the right direction
using Access, it would be greately appreacited.

Thanks.
 
D

Doug Robbins - Word MVP

You do not need VBA. You create a query in Access that would include a
field containing an expression such as:

Footer: IIF([Name] = "John", "Johns Details", "Hello World")

Then you use that query as the data source for your mailmerge and in the
footer of the document, you insert the Footer field.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top