Solved

Access VBA

Posted on 2013-05-24
9
349 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
  • 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 47

Expert Comment

by:Dale Fye (Access MVP)
ID: 39194955
Have you looked at the help on:

Docmd.TransferSpreadsheet
0
 
LVL 7

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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
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 47

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 7

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now