Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Modules / DAO / VBA / January 2006

Tip: Looking for answers? Try searching our database.

Word and Access

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bruno Coelho - 30 Jan 2006 12:16 GMT
Hi,
Happy new year!!!!!!
I want to know if is possible to agrup Word and access tables? Been more
expecifically, i want to do a template in word, that have a table with 3
columns. 1st - Code; 2nd - product; 3rd - quantity; and each line of this put
a combobox that will be connect to a table of Access and select the name??
I wnat to know if is possible to do a connection Word-Access? if is, i would
like to know how??
Thanks
Tim Ferguson - 30 Jan 2006 18:11 GMT
=?Utf-8?B?QnJ1bm8gQ29lbGhv?= <coelhones85@hotmail.com.pizzadox> wrote in
news:8D952847-774D-4C83-972E-2391196F4174@microsoft.com:

> I want to know if is possible to agrup Word and access tables? Been
> more expecifically, i want to do a template in word, that have a table
> with 3 columns. 1st - Code; 2nd - product; 3rd - quantity; and each
> line of this put a combobox that will be connect to a table of Access
> and select the name?? I wnat to know if is possible to do a connection
> Word-Access? if is, i would like to know how??

I am not clear exactly what you are trying to achieve here, but the
answer is yes.

1) If you want a three-column table, I would use the Access report writer
because it's so easy

2) If there is some reason to want to do this in Word, you can use the
MailMerge wizard to set it all up for you.

3) If the wizard won't do quite what you want, turn on the field codes
and set up the fields as you want. The <<nextrecord>> field is your
friend here (I think).

4) If you are still more fussy, or are just a masochist, you can program
the whole thing in Word without bothering with Access at all. You attach
directly to the database using something like

 
 ' can't remember the exact definition string; look it up in your
 ' registry
 set dbe = CreateObject("DAO.360.DBEngine")
 ' readonly nonexclusive access to the database
 set db = dbe.OpenDatabase("c:\MyData\TheDatabase.mdb", false, false)
 ' remember to look up the constants and define them somewhere...
 set rs = db.OpenRecordset("SELECT etc etc etc", _
          dbOpenSnapshot, dbForwardOnly)

 
 ' I am imagining the Word table model; you'll have to look it up
 ' for yourself
 Do While Not rs!EOF
   with wordTable
     with .AddRow
       .Cell(0).Text = rs!FirstField
       .Cell(1).Text = rs!SecondField
       .Cell(2).Text = rs!ThirdField
       ' don't forget to move forward in the recordset,
       ' otherwise you will have a very long document!!
       rs.MoveNext

     end with
   end with
 Loop

Look: no Access!!

Hope that helps

Tim F

 
Bruno Coelho - 31 Jan 2006 13:19 GMT
hi,
i will go to do all in access,
thanks anyway

> =?Utf-8?B?QnJ1bm8gQ29lbGhv?= <coelhones85@hotmail.com.pizzadox> wrote in
> news:8D952847-774D-4C83-972E-2391196F4174@microsoft.com:
[quoted text clipped - 57 lines]
>
>  
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.