Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    KingOf206 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2013
    Location
    Seattle
    Posts
    153

    Question Need to take 1 column of data from a report and export to a text file (notepad)


    I have a picture of a report that I generate on a daily basis. I need to extract only 1 column of data from it. The far right column of data (the AVID #'s) is what i need to extract and I need it sent directly to a text file (sent to notepad).

    Right now the only work around I have i sending the entire report to excel, then copying the avID #s and only then can i paste them into a notepad. this is a hastle of a work around, when i feel like there is some easy way I am missing.

    Is anyone familr with how ot do this? Please help! Thanks again!

    Click image for larger version. 

Name:	report1.jpg 
Views:	7 
Size:	89.1 KB 
ID:	12994

  2. #2
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Is your Report based on a query or a table?
    How I would approach it is to create a new query that uses the same Data Source as your Report, but only lists/shows the one column you want. Then do the export from the query, not the report.

  3. #3
    KingOf206 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2013
    Location
    Seattle
    Posts
    153
    I have this report based off a query (that includeds criteria, the criteria I have to enter is listed at the top of the report). The issue I have though Is that I need to generate the text file from this report. the reson so is because I have this dataase setup for users to work on. I only give them access to reorts and forms. so I would have to have it generate form one of the 2.

    Ideas?

  4. #4
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    You can create a command button on a Form that will export the data you want.

    I have done stuff like you have said. If you use a Selection Form, where they enter their criteria there, you can "bind" those criteria selections to a table, and make use of that table in your other queries (so that they run based off of the same criteria).
    Or alternatively, you could use their Criteria selection to build the SQL code for your queries on-the-fly, and apply the SQL code to pre-existing queries you have set up.

  5. #5
    KingOf206 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2013
    Location
    Seattle
    Posts
    153
    Is it possible to put this "command button" on the report it self? And if it is, what command would I use? I hav enot been able to do it thus far...

    Quote Originally Posted by JoeM View Post
    You can create a command button on a Form that will export the data you want.

    I have done stuff like you have said. If you use a Selection Form, where they enter their criteria there, you can "bind" those criteria selections to a table, and make use of that table in your other queries (so that they run based off of the same criteria).
    Or alternatively, you could use their Criteria selection to build the SQL code for your queries on-the-fly, and apply the SQL code to pre-existing queries you have set up.

  6. #6
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    How are they entering the Criteria for the Report? You cannot make entries directly on your report, right?
    As far as making the command button, take a look at the Macros section, and you can create a Macro to export a query/table to Excel using the Transferspreadsheet command. You just create the Macro or VBA to do that, and have the command button run that Macro or VBA code.

  7. #7
    KingOf206 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2013
    Location
    Seattle
    Posts
    153
    Correct. I have the Report based of a query that asks for the informaiton that is pictured at the top of the report. No, entries cannot be made directly on the report. I do not know VBA. I have tried doing in using a macro but have not been able to. do i need to base it off a new query?

  8. #8
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    I have the Report based of a query that asks for the informaiton that is pictured at the top of the report.
    Create a bound from that asks that for information. Since that criteria information would then be stored in a table, you can use it in other queries, reports, forms, etc.
    So you could have them fill out the criteria, and then click a single command button which would then run a report and export a query.

  9. #9
    KingOf206 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2013
    Location
    Seattle
    Posts
    153
    What I have done is create another button on the report that will run a different query that uses the same criteria as the report. However, when I do export that data it goes to a text file but it has all these "extra" formatting lines. SEE ATTACHED IMAGE.

    Click image for larger version. 

Name:	Untitled.jpg 
Views:	6 
Size:	85.0 KB 
ID:	13003I want to export it so it shows DATA only, so that the numbers are the only thing on the page (if possible I would also like the Header to NOT appear, but I can deal with that, just not all the other ofmratting lines.)
    Attached Files Attached Files

  10. #10
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Are you exporting the query or a report?
    Are you using the TransferSpreadsheet or TransferText action?

  11. #11
    KingOf206 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2013
    Location
    Seattle
    Posts
    153
    aT FIRST i WAS EXPORTING FROM THE query. I now have a report that is generated from a query, I am SOOOOoooo close. but it is still not right. I have got rid of all the formatting lines but now I have all these random spaces in the note pad. Is there some other formatting changes I can do to make things linear?

    right now I have this:Click image for larger version. 

Name:	Untitled.jpg 
Views:	5 
Size:	62.3 KB 
ID:	13004

    But I want my data to export like this: Click image for larger version. 

Name:	Untitled11.jpg 
Views:	5 
Size:	70.5 KB 
ID:	13005

  12. #12
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    Can you post all the arguments you are using in your Macro?

  13. #13
    KingOf206 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2013
    Location
    Seattle
    Posts
    153
    I am not using a macro. I created a 2nd queary that uses the same criteria as the current report I use, however the only informaiont that I have to "appear" (show) is the AV ID #'s then i have created a 2nd report (AV-ID list) that is based of that same queary that just generates the numbers. I added a button to the Report 1 (the one which I currently use) so that it runs the AVI ID list report and sends that data to a text file. That is when all the formatting gets screwed up like the picutrres above. DId that answer your question? if not please let m eknow so that i cna clearify.

  14. #14
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    I added a button to the Report 1 (the one which I currently use) so that it runs the AVI ID list report and sends that data to a text file. That is when all the formatting gets screwed up like the picutrres above. DId that answer your question? if not please let m eknow so that i cna clearify.
    Behind every button, there is a Macro or VBA code. What is the code/Macro that the button is running?

  15. #15
    KingOf206 is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Apr 2013
    Location
    Seattle
    Posts
    153
    yes you are right. Here is what I have.Click image for larger version. 

Name:	Untitled.jpg 
Views:	6 
Size:	79.1 KB 
ID:	13022

Page 1 of 2 12 LastLast
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 7
    Last Post: 10-27-2012, 07:19 AM
  2. Get Export File name from Unbound Text Box
    By FinChase in forum Import/Export Data
    Replies: 1
    Last Post: 01-11-2012, 11:09 AM
  3. trying to export data to a text file
    By itm in forum Access
    Replies: 1
    Last Post: 06-30-2011, 10:40 AM
  4. Replies: 1
    Last Post: 06-09-2011, 11:10 PM
  5. Replies: 6
    Last Post: 05-11-2010, 02:22 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums