Results 1 to 5 of 5

Thread: [RESOLVED] Inserting Captions for Tables

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2008
    Posts
    2

    Resolved [RESOLVED] Inserting Captions for Tables

    Hello,

    I am writing a Visual Basic macro in Word to format data that I extracted from Microsoft Access into tables. Is there a way to insert captions for these tables using my own values for Table Numbers? Currently, when I use .InsertCaption, I get labeling such as Table 1, Table 2, etc. I have a column in Access that contains the specific table numbers that I want for each table that I created (such as 3.2.1-1 for example). Is there a way that I can use these Table Numbers instead?

    Thanks for your help!

  2. #2

  3. #3
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Inserting Captions for Tables

    Welcome to the forums.

    Here is how to get field names. Modify this to fit your needs.
    Code:
    Dim db As Database
    Dim td As TableDef
    
    Set db = Opendatabase("databasepath")
      For Each td in db.TableDefs
           ComboBox1.Additem td.Name
      Next
    Instead of adding them to a combo box, use them as a Caption.

  4. #4

    Thread Starter
    New Member
    Join Date
    Aug 2008
    Posts
    2

    Re: Inserting Captions for Tables

    Thank you for your help!

  5. #5
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: Inserting Captions for Tables

    Now that we've helped you, you can help us by pulling down the Thread Tools menu and selecting the Mark Thread Resolved item which will let everyone know that you have your answer. Also if someone has been particularly helpful you have the ability to affect a their forum "reputation" by rating their post. Only those ratings that you give after you have 20 posts will actually count, but the person you rate will see it and know that you appreciate their help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width