Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
S.Hanagan
 
Posts: n/a
Default Using access data to fill-in pre-printed report forms

Aside from using the cumbersome mail merge, is there a decent way to take
access data and use it to fill-in a printable form? By "form" I mean like a
tax return, not an access "form."
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
 
Posts: n/a
Default Using access data to fill-in pre-printed report forms

There are various ways of doing this. For one, see the article "Access a
database and insert into a Word document the data that you find there" at:

http://www.word.mvps.org/FAQs/InterD...DataFromDB.htm

The following procedure in the Initialize event of a UserForm in Word can be
used to load a list box on that form with the records from a table in Access
so that the user can select the record that they want and then have the data
from that record inserted into the document that is created when a new
document is created based on the template in which the userform is located.

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

"S.Hanagan" wrote in message
news
Aside from using the cumbersome mail merge, is there a decent way to take
access data and use it to fill-in a printable form? By "form" I mean like
a
tax return, not an access "form."


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
merge from access report leabee1 Mailmerge 1 October 4th 05 07:42 PM
format text to change data in report with word 2003 Template Mary Microsoft Word Help 2 September 20th 05 10:25 PM
Extract data from word doc to access database CAD Fiend Microsoft Word Help 1 June 22nd 05 05:24 PM
Mailmerge data source in an Access database will not open Colin C Mailmerge 3 December 31st 04 12:01 AM
exporting accress reports into word marc Microsoft Word Help 8 December 29th 04 04:40 PM


All times are GMT +1. The time now is 03:15 PM.

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"