Solved

Access VBA

Posted on 2013-05-24
9
357 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 (Access MVP)
ID: 39194955
Have you looked at the help on:

Docmd.TransferSpreadsheet
0
Office 365 Training for IT Pros

Learn how to provision tenants, synchronize on-premise Active Directory, implement Single Sign-On, customize Office deployment, and protect your organization with eDiscovery and DLP policies.  Only from Platform Scholar.

 
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 (Access MVP)
Dale Fye (Access MVP) earned 100 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 400 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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

I was prompted to write this article after the recent World-Wide Ransomware outbreak. For years now, System Administrators around the world have used the excuse of "Waiting a Bit" before applying Security Patch Updates. This type of reasoning to me …
Outlook for dependable use in a very small business   This article is about using the Outlook application (part of Microsoft Office) in a very small business, or for homeowners where dependability and reliability are critical requirements. This …
The viewer will learn how to  create a slide that will launch other presentations in Microsoft PowerPoint. In the finished slide, each item launches a new PowerPoint presentation and when each is finished it automatically comes back to this slide: …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

696 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