Results 1 to 15 of 15
  1. #1
    Join Date
    Apr 2003
    Location
    paris, FRANCE
    Posts
    88

    Unanswered: PLEASE HELP!! export table to word

    Hello, I use MS Access 2k2 on Windows Xp.

    I have created an application thanks to the great concentration of grey matter on this forum.
    I now get down to publishing my results to my clients in a clean way. Indeed, I want to export my results, and not all the results but only the filtered results, to word document, which will be emailed to my clients.

    To explain quickly, the results can be viewed by using a form with cascade filters which filter the information shown on a first report.
    This form therefore filters the raw information, and once filtered enough, allows the user to have more details on the results. This more detailed report is only different from the first report in the quantity of data shown, as it refers to the same table.

    For example the first report gives the names, and the more detailed report gives names + adress + organisation details.

    So much for the explanation.

    What I want to know is how I can export on a single click only the filtered data and not all the results contained in my results table. As I use buttons to filters the results and view the details, I'd like to have a button which, when pushed, transfers the results to the word document.

    Does anybody know a similar issue?

    Can I use the code9.zip posted here, or does someone know a better code which could be adapted to this task?

    Thanks for the help
    Cheers

    nico
    Last edited by nicolascaprais; 09-17-03 at 16:04.

  2. #2
    Join Date
    Apr 2003
    Location
    paris, FRANCE
    Posts
    88

    Example

    I see no one has taken time to look at my issue...
    here's an example
    it contains the table source to my reports, the filtering form, and the two reports.
    The first one (rptCustomers) helps me to view the totality of the matches, and the second one (rptCordisDetails) a more detailed description of each match appearing on the first one.

    What I wanna do is have a button on my form which exports the chosen report to a word file. Behind the "Details" button there's the code which gives the information to be displayed to the report. The results of my filters is the strSQL2 string, and I want my "Export" button on the form to take that value and export the chosen report(s) to a word document.

    Is this too much of a hassle?

    I appreciate your help!

    cheers
    nico
    Attached Files Attached Files

  3. #3
    Join Date
    Jul 2003
    Location
    Italy
    Posts
    139
    Your problem, as far as I know, is not very easy to solve.

    First of all it seems that exporting to word isn't simple and mighty Microsoft suggest to use a 'snapshot'. See this article for more info:

    http://support.microsoft.com/default...B;EN-US;307184

    Second if you want to export to word you can use this:

    http://www.lebans.com/ReportUtilities.htm

    Read everything carefully.

    Another solution seems to be this:

    http://www.planet-source-code.com/vb...=3799&lngWId=1

    That's all I can say. I'm sorry if I'm not of any great help.

    Oh, by the way, you can always buy an add in to do that. Buy... :-)
    Marco
    ---Do not send e-mail---
    "New Big Bang Theory: God said unzip universe"

  4. #4
    Join Date
    Apr 2003
    Location
    paris, FRANCE
    Posts
    88
    Thx marco for your frankness!!!!
    What if I want to export the reports as HTML files? Would it be easier?

    I'll try to get it done by myself first... But its been a week since I have been looking for a solution and I can't find it anywhere...

    Where can I buy such an add in? Do I have to contact a special VBA developper team or do such ready use add in already exist?

    cheers nico

  5. #5
    Join Date
    Jul 2003
    Location
    Italy
    Posts
    139
    Well...

    I must admit that all the info I posted were found on the web. Looking all those link spit out by Google, there were lots of sites selling add ins... I'm sure that the macro command transfertotxt might be of help. And HTML export could be easier.

    By the way have you seen the word icon in the preview of a report? Well that command should be reached using the DoCmd function... hmmm... light up something?

    Look for the OutputTo function... better: look for the DoCmd object and then the methods in A2K help... this seems to be very uselful. Well, it can output a report in different formats... hmmmm... actually could be very easy...

    As you can see I'm discovering things myself for the first time... so if I find something I will tell you.
    Last edited by Marco Del Corno; 09-18-03 at 05:22.
    Marco
    ---Do not send e-mail---
    "New Big Bang Theory: God said unzip universe"

  6. #6
    Join Date
    Jul 2003
    Location
    Italy
    Posts
    139
    Yes!

    DoCmd OutPutTo

    is your solution!

    Look for it in the help file!
    Marco
    ---Do not send e-mail---
    "New Big Bang Theory: God said unzip universe"

  7. #7
    Join Date
    Apr 2003
    Location
    paris, FRANCE
    Posts
    88

    Talking oh my....

    Marco,

    now that you tell me that, I remember this blue W icon mentionned somewhere when searching thru old posts...

    My trouble is that I wouldn't know how to write the code (even the simpliest lines), because I only understand partially all the functions. I learnt the C coding at university (which is really close to VB I agree) but I have only been playing with access for 3 months, and on top of that I don't have the "logical common Access way of thinking" like you all.

    Therefore speaking of specific commands is understandable for me (like DoCmd object or function, any difference???), but applying these commands, would require for me to totally understand declaration types, declaration structures and so on... And I don't have the time as the programming of my application is only part of the whole task. The latter includes, interface design, contact with clients, and every day stuff when you work in a 5 persons firm...

    Thanks for your help I appreciate it, I am searching right now for a solution, let me know if you find something new!

    cheers
    nico

  8. #8
    Join Date
    Apr 2003
    Location
    paris, FRANCE
    Posts
    88
    OK!!!
    but how?
    I am like in front of my after meal cigarette with no matches!!!

    nico

    Originally posted by Marco Del Corno
    Yes!

    DoCmd OutPutTo

    is your solution!

    Look for it in the help file!

  9. #9
    Join Date
    Jul 2003
    Location
    Frankfurt, Germany
    Posts
    20
    hi nico

    i´ve been doing data exports to word in a couple of projects now and found the best way to work fast and flexible in the following way
    (which of course needs a little vb programming :-) ):

    1) the word document is a mail merge document
    preferrably a nice template file

    2) always use export to txt-files instead of basing the word document
    on a table or view directly (100 times faster, believe me)

    3) a lot of filter and formatting stuff can be done
    during the export already

    4) before actually DOING the merge u can manipulate the merge
    document through vb code in access, for example there is something
    like
    Word.Application.ActiveDocument.MailMerge.DataSour ce.QueryString
    = "..."
    where you can actually manipulate the rows affected
    before merging them from the source to the destination

    nico, i hope i could give u some (new?) ideas, if you are interested in a code sample let me know (but would need till the weekend to extract from my projects)
    good luck so far
    cr
    citizen.ron@t-online.de

  10. #10
    Join Date
    Jul 2003
    Location
    Italy
    Posts
    139
    Originally posted by nicolascaprais
    OK!!!
    but how?
    I am like in front of my after meal cigarette with no matches!!!

    nico

    Ok!

    Open the report in design mode.
    Open the report property.
    Click on the on event tab.
    Click on onload event and choose code.
    Copy this line in the vb code page

    DoCmd.OutputTo acOutputReport, "A", acFormatRTF, "B.rtf", True

    Change A to the name of your report

    acFormatRTF could be acFormatHTML if you want to output to html

    Change B with the word file name

    True means that the word file will be opened

    I believe that this is a good starting point.

    Cheers!
    Marco
    ---Do not send e-mail---
    "New Big Bang Theory: God said unzip universe"

  11. #11
    Join Date
    Jul 2003
    Location
    Italy
    Posts
    139
    A better solution!!

    Look at the file enclosed.
    Attached Files Attached Files
    Marco
    ---Do not send e-mail---
    "New Big Bang Theory: God said unzip universe"

  12. #12
    Join Date
    Apr 2003
    Location
    paris, FRANCE
    Posts
    88

    Thumbs up You are the S**t!!!!

    Thats a master piece marco thanks so much!!!! It works perfectly!!!
    If you are ever in Paris email me and I'll buy dinner!!!
    Thanks to you also citizen.ron!

    That's one hell of a job you guyz did! I was in a dead end, great collaboration!

    peace
    nico
    Last edited by nicolascaprais; 09-18-03 at 09:17.

  13. #13
    Join Date
    Jul 2003
    Location
    Italy
    Posts
    139
    Surely I would like to take a trip to Paris... I've been there when I was very young... anyway money can't allow me such a trip.

    Oh just as I remember, I've been to the Loir Valley (forgive my mispelling) on the 11th of september 2001... what a day! But the place is wonderful!!!

    Cheers!
    Marco
    ---Do not send e-mail---
    "New Big Bang Theory: God said unzip universe"

  14. #14
    Join Date
    Apr 2003
    Location
    paris, FRANCE
    Posts
    88
    Yep! all te nice castles are there!
    But no plane ever flyes close to these buildings!
    Loire valley isn't far from Paris you know its about 2 or 3 hours by train!

    I am actually from toulouse (south west), its more rural but more fun than in paris were all the trendy clubbers live! What I like is good parties not just "people watching" parties!

    And I am leaving next month for Japan, its my first "real" job (real as a job where I'll use what I learnt at the university!). I'll be in tokyo working for the french embassy!!! I'm really excited about it!!!!

    Anyways thanks again for your great help!!!
    Don't hesitate to contact me! >>>> nicolascaprais@yahoo.fr

    c ya!
    nico
    PS: Is that you on the cover of the magasine????? lol
    Attached Thumbnails Attached Thumbnails success.gif  

  15. #15
    Join Date
    Mar 2004
    Posts
    361

    Major Query vs Report Issue

    I have a query that spits out a 14 by 14 style matrix in a report. The query works but I had to make it a make table query so the report would accept it. I have the same situation with another query and report. My problems is I need to sum the numbers on both of those queries to fill another matrix like report. I tried to add all the functions from both queries but it says the query is to complex. Do you guys have any ideas on how I can do this without having to wait 10 minutes for both reports to query and run? Thanks!

Posting Permissions

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