Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

access interface with word

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I maintain a youth soccer database with access. When registration comes around we have people fill out by hand numerous forms stored in word format. We then enter this data manually onto our access database. When people reregister I would like to link up their database record with our forms on word and fill in the information we have on the database. Can I define variables that exist on the access database within a word document? How do I establish the link and get word to work with access?

Thanks
 
Yes. I prefer outputting my source data (a table or query containing the fields I want to include on a form letter) to an Excel spreadsheet. The next thing I do is create a mail merge file using my source document, i.e.; in your case the soccer registration form.

Open your Word.doc click "tools" and then "mail merge." Follow the instructions per the wizard. Basically you want to create a "form letter", "active window", "get data", "open source file" select your save Excel spreadsheet and "edit main document." To select the desired fields you want to include in your form letter, click the "insert merge field" in the desired location on your word document. The procedure is basically the same if you want to create a mail merge in Access … hit the Word or Excel icon on the menu bar.

I hope this helps!
 
I would like to merge with only one data record. I can do it from word using query and filters but that seems like a pain for atheuser. Is there a way to select the record from access and merge just one record from the database?
 
I think this should work.
First create the appropriate query in Access
Then within Word use the Mail Merge/Open Data Source with 'Files of Type' set to 'MSAccess Databases'. Browse for the database, open and you will see 2 sets of tabs - one for tables the other for queries. Use whichever Query you like and then insert the required fields.
You could also do a similar thing using MSquery.
 
Hi, there a various ways to do what you want, that is, insert current Access data into a Word Template automatically without using the mail merge function. First Bookmark the template with the fields you want from the access table. Then create a command button to merge. I have included the coding I use for this purpose. You will have to change some things to suit your particular needs, but it will give you a general idea of how it is done. There are also other ways to accomplish the same thing, but this is the simpliest. I have also created a form which will filter out records and print just selected info onto the word template. Let me know how you make out. Good Luck


'Start of Code

Public Function CreateWordMemo()
' Open a memo in Word and insert text - used by menu command.

Dim rstEmployees As New ADODB.Recordset
Dim appWord As New Word.Application
Dim intPages As Integer, strMessage As String

' Open a recordset based on the PANotDone query.
rstEmployees.Open "PANotDone", _
CurrentProject.Connection, adOpenKeyset, adLockOptimistic



' If no one has open PAs, display a message and exit.
If rstEmployees.RecordCount = 0 Then
DisplayMessage "There are no Outstanding PAs to announce."
Exit Function
End If

' Open a document based on the memo template, turn off spell check,
' move to the MemoToLine bookmark, and then display Word.
With appWord

.Documents.Add "C:\Documents and Settings\BMeunier\My Documents\ProfessionalMemo"
.ActiveDocument.ShowSpellingErrors = False
.Selection.GoTo wdGoToBookmark, Name:="MemoToLine"
.Visible = True
End With

' Loop through the recordset returned by the query, inserting
' the name of each employee into the document.
Do Until rstEmployees.EOF
appWord.Selection.TypeText rstEmployees!EmployeeName & " "
rstEmployees.MoveNext
Loop

' Return to Access.
AppActivate "Operations "

'End of Code
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top