Reply
 
Thread Tools Display Modes
  #1   Report Post  
DOGMA-DOT
 
Posts: n/a
Default inserting ACCESS fields in a word document

I have a WORD letter I use each month. The name of the person to whom it is
directed changes frequently in this (and other letters). Is there a way to
get a field(s) from an ACCESS table - possibly in a drop down box - to
insert in the letter when I get ready to print it? I'm sure it is possible,
but
frankly the info provided by WORD help is not a lot of use.

In addition, what is the best "text" book on WORD 2000 available in
bookstores.

Dot
  #2   Report Post  
Doug Robbins
 
Posts: n/a
Default

See the article "How to create a
Userform" at:

http://word.mvps.org/FAQs/Userforms/CreateAUserForm.htm


The the following routine will populate a listbox or combobox with data from
an Access database

Private Sub UserForm_Initialize()
Dim db As DAO.Database
Dim rs As DAO.Recordset
Dim NoOfRecords As Long
' Open the database
Set db = OpenDatabase("D:\Access\ResidencesXP.mdb")
' Retrieve the recordset
Set rs = db.OpenRecordset("SELECT * FROM Owners")
' Determine the number of retrieved records
With rs
.MoveLast
NoOfRecords = .RecordCount
.MoveFirst
End With
' Set the number of Columns = number of Fields in recordset
ListBox1.ColumnCount = rs.Fields.Count
' Load the ListBox with the retrieved records
ListBox1.Column = rs.GetRows(NoOfRecords)
' Cleanup
rs.Close
db.Close
Set rs = Nothing
Set db = Nothing
End Sub


--
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
"DOGMA-DOT" wrote in message
news
I have a WORD letter I use each month. The name of the person to whom it
is
directed changes frequently in this (and other letters). Is there a way
to
get a field(s) from an ACCESS table - possibly in a drop down box - to
insert in the letter when I get ready to print it? I'm sure it is
possible,
but
frankly the info provided by WORD help is not a lot of use.

In addition, what is the best "text" book on WORD 2000 available in
bookstores.

Dot



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Please give us REVEAL CODES like WORD PERFECT not reveal codes in. Rachel King Microsoft Word Help 38 August 21st 09 09:54 PM
Envelope Address GR New Users 5 April 24th 05 09:48 PM
1st word in heading flush left second word flush right Elin New Users 9 April 4th 05 08:44 PM
Word Document: merging a lot of info from Access pepenacho Mailmerge 1 March 22nd 05 09:01 PM
letters - ask/fillin Caroline H New Users 2 February 25th 05 08:19 PM


All times are GMT +1. The time now is 08:36 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"