Results 1 to 10 of 10
  1. #1
    Join Date
    Nov 2003
    Location
    New Zealand
    Posts
    47

    Unanswered: can word talk to access

    hi everyone.

    I am creating a word form with activeX components. I would like to populate a combobox with data form a access database. I know VBA but i don't know how to access the database form word or VB. Do i need a ODBC driver or what. How does mail merge work.

    Once the combobox is populated i then want the word document to change accordingly....but thats later on down the track first i need to be able to extract data from the access database first.

    thanks in davance. also how do i view my post with out searching for them.....?
    Nerdy Girl

  2. #2
    Join Date
    Sep 2002
    Location
    Land of OZ
    Posts
    173

    Re: can word talk to access

    Originally posted by nerdy_girl
    hi everyone.

    I am creating a word form with activeX components. I would like to populate a combobox with data form a access database. I know VBA but i don't know how to access the database form word or VB. Do i need a ODBC driver or what. How does mail merge work.

    Once the combobox is populated i then want the word document to change accordingly....but thats later on down the track first i need to be able to extract data from the access database first.

    thanks in davance. also how do i view my post with out searching for them.....?
    Want to email me a copy of the db and word doco, and I will write some code for you ...
    Mona
    ________________________________
    Life is too short to be sane or sensible. Weird people rule and normal people suck

  3. #3
    Join Date
    Oct 2003
    Posts
    311

    Re: can word talk to access

    Originally posted by nerdy_girl
    hi everyone.

    I am creating a word form with activeX components. I would like to populate a combobox with data form a access database. I know VBA but i don't know how to access the database form word or VB. Do i need a ODBC driver or what. How does mail merge work.

    Once the combobox is populated i then want the word document to change accordingly....but thats later on down the track first i need to be able to extract data from the access database first.

    thanks in davance. also how do i view my post with out searching for them.....?
    i dont know word but i know some ado so...

    in the form open try :
    dim sql as string
    SQL= "SELECT * FROM TABLENAME"
    dim rs as adodb.recordset 'YOU NEED TO SET REFERENCE TO ADO

    rs.open SQL, CONNECTIONSTRINGINFO, 'fill in the rest of the params
    if not rs.eof then
    do while not rs.eof
    ComboBox1.AddItem rs(index of item to add or field name)
    rs.movenext
    Loop

    Sorry cant give more help i have to work on my car
    if you need more leme know what u need on ado and i can help

    M~

  4. #4
    Join Date
    Oct 2003
    Location
    Boston, Mass. USA
    Posts
    81
    mail merge *should* work, unless you've got an ancient version of MS Word. It should let you pull an access table or query (or excel spreadsheet) in as your source. It may in fact be easier to manipulate strings on the Access side. But if you are on a network, (not having everything on one PC) you probalby need an ODBC driver.and that I don't know much about setting those up. You could also write your letter as an Access report and skip trying to make the two programs talk to each other - not always "so easy" despite microsofts claims

  5. #5
    Join Date
    Sep 2002
    Location
    Land of OZ
    Posts
    173

    Re: can word talk to access

    Originally posted by mikezcg
    i dont know word but i know some ado so...

    in the form open try :
    dim sql as string
    SQL= "SELECT * FROM TABLENAME"
    dim rs as adodb.recordset 'YOU NEED TO SET REFERENCE TO ADO

    rs.open SQL, CONNECTIONSTRINGINFO, 'fill in the rest of the params
    if not rs.eof then
    do while not rs.eof
    ComboBox1.AddItem rs(index of item to add or field name)
    rs.movenext
    Loop

    Sorry cant give more help i have to work on my car
    if you need more leme know what u need on ado and i can help

    M~
    In word, ensure that you have the required references set to do this. I

    f you are using ADO then set a ref to Microsoft ActiveX Data Object 2.1 Library.

    If you are intending on using DAO extraction, you will need to set a reference to Microsoft Access Object Library and to Microsoft DAO 3.6 Object Library
    Mona
    ________________________________
    Life is too short to be sane or sensible. Weird people rule and normal people suck

  6. #6
    Join Date
    Nov 2003
    Location
    New Zealand
    Posts
    47

    Question

    thank you for all your replies..I LOVE IT.....

    but unfortunately i don't know what ADO or DAO are????? can anyone explain????

    I am using word because i am unable to edit an access report once it is generated.

    I'm thinking about generating a word document form access....would that be easier...?

    thanks in advance.
    Nerdy Girl

  7. #7
    Join Date
    Nov 2003
    Posts
    267
    WHen you say you are unable to edit an Access report once it is generated, what are you wanting to change?

    S-

  8. #8
    Join Date
    Nov 2003
    Location
    New Zealand
    Posts
    47
    i would like to have a table in the report with predined rows and columns, and i would like to have fields that i can enter figures into after the report is generate. I am making a quote to send to clients and the $ figures change randomly. I would like to be able into enter them in after the report in genreated.
    Nerdy Girl

  9. #9
    Join Date
    Nov 2003
    Posts
    267
    You can publish or merge any query or table with MS Word.

    Mail Merge takes any recordset and combines it with an exisit word document (template) that has the fields predefined in where to place the fields in you recordset

    Publish lets you take an existing query or table and publish it to a new word document, where you can create your document at the time.


    My preference it to design my database so that all information is already stored in teh DB and then create the report without allow editing after the fact. Most of my clients have prefered that, but it isn't for everyone.

    You will most likey want to use mail merge. Look in the help for more information.

    Good Luck

    S-

  10. #10
    Join Date
    Nov 2003
    Location
    New Zealand
    Posts
    47
    thanks S-
    I too prefer to have all the data in the database and generate reports with that.

    This client is a tricky one hes wants structure AND flexibility.

    Thanks for you help i will look into publisher.
    Nerdy Girl

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •