Solved

Access VBA

Posted on 2013-05-24
9
353 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
Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

 
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
 
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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

In this article we discuss how to recover the missing Outlook 2011 for Mac data like Emails and Contacts manually.
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
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…

772 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