Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access VBA
|
Access VBA Discuss using VBA for Access programming.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access VBA section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 10th, 2004, 10:59 AM
Registered User
 
Join Date: Nov 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Need help creating word report from Access VBA

I am creating a report that require a person's name to appear in over 50 areas in the report. and the name to be obtained from a database.

I want to use bookmarks to insert the name, but I don't want to create that many bookmarks and write that much code to change one thing.

is there a good way or better way of doing this? I wish i could be able to have one bookmark point to all names, and change everything using one line of code, but the bookmark doesn't seem to work that way.

PLEASE HELP

 
Old November 10th, 2004, 01:49 PM
Authorized User
 
Join Date: Oct 2003
Posts: 75
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Is there a way that you can produce the report within MS Access? The reason I am asking is because the topic indicates a Word report. If so, I can show you a quick way to populate as many name fields as you have quickly once you have retrieved the name of the person. If you have any examples of table name, column name, how the name is to be retrieved, it can be integrated into the sample code.
 
Old November 10th, 2004, 05:24 PM
Registered User
 
Join Date: Nov 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks wscheiman for ur response

the code below is what i have so far
but i can only change one instance of FullName.
I tried using captions so I can have the same caption in multiple places in the
word doc, but caption was not recognized

It would be much easier to do it in vb, but I was instructed not to.
I WOULD APPRECIATE ANY SUGESTIONS OR ADVICE


Set objword = CreateObject("word.application")
  With objword
  .Visible = False
  .Documents.Open ("c:\maps\lkms\Template.doc")
  End With
With objword
    .activedocument.Bookmarks("FullName").Select
    .Selection.Text = rstTextBlock.Fields(1).Value
    '.activedocument.Caption("FullName").Select
    '.Selection.Text = rstTextBlock.Fields(1).Value
End With





Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating Media Player 11 Object in Access VBA LouG Access VBA 12 October 20th, 2008 10:12 AM
Generating report via VBA in Access gurkie Access 2 July 16th, 2006 02:16 PM
Word Merge with Access VBA echovue Access 6 May 5th, 2006 05:11 PM
Access/Vba mail merge to word help alfonse Access VBA 0 July 28th, 2005 05:11 AM
Creating New Document In Word Through vba Hari_Word Excel VBA 1 July 22nd, 2004 05:50 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.