[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Access VBA

Posted on 2013-05-24
9
Medium Priority
?
359 Views
Last Modified: 2013-05-24
Hello,

Access Possibility
Grab a table data (myTable101) and spit that out sheet1 of C:\RR\myExcelFile.xlsx
Is that possible?


Can someone assist?

thanks
0
Comment
Question by:Rayne
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
  • +1
9 Comments
 

Author Comment

by:Rayne
ID: 39194934
a veyr good vba to do this, thank you
0
 

Author Comment

by:Rayne
ID: 39194936
Button on access that will call the macro – which will grab the data from the access table and then spit it out on excel file, stored somewhere…
0
 
LVL 48

Expert Comment

by:Dale Fye
ID: 39194955
Have you looked at the help on:

Docmd.TransferSpreadsheet
0
Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

 
LVL 8

Expert Comment

by:MSmax
ID: 39194974
Well you don't need any code for that.

You can simply import the table (or query) directly to Excel file and refresh the table whenever you need it.

VBA is also the option (let me know from where you want to run it Access or Excel).

Let me know what version of the Excel and Access do you have so I can assist you further.

Regards,

MSMax
0
 
LVL 12

Expert Comment

by:pdebaets
ID: 39194985
0
 

Author Comment

by:Rayne
ID: 39195064
Hello MsMax

VBA is also the option (let me know from where you want to run it Access or Excel).
------- I would want to run the macro from within Access (preferably a form button)  - which opens up a specific excel file and  dumps the access table data

Let me know what version of the Excel and Access do you have so I can assist you further.
-----Excel 2010, Access 2010
0
 
LVL 48

Assisted Solution

by:Dale Fye
Dale Fye earned 400 total points
ID: 39195096
As I posted above, have you looked at the Help topic for the TransferSpreadsheet method?
0
 
LVL 8

Accepted Solution

by:
MSmax earned 1600 total points
ID: 39195186
Please use something like that with on Click Event:


Private Sub Command0_Click()
On Error GoTo Err_Command0_Click


DoCmd.TransferSpreadsheet acExport, acSpreadsheetTypeExcel8, _
    "TableNameorQueryName", "C:\WorkbookName.xls"

Exit_Command0_Click:
    Exit Sub

Err_Command0_Click:
    MsgBox Err.Description
    Resume Exit_Command0_Click
    
End Sub

Open in new window

0
 

Author Closing Comment

by:Rayne
ID: 39195650
thanks
0

Featured Post

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
With its various features, Office 365 can not only help you with your day-to-day business tasks, it can also do wonders for your marketing campaign.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question