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