RunCiode in a Macro

CoffeeGuru

Registered User.
Local time
Today, 22:21
Joined
Jun 20, 2013
Messages
121
I have a report that I want to export to Excel
however it is generally around 100K lines

The reaqson for Excel is the pivot table and cahrt capabilities that Access does not do so well.

Due to th efile size I cannot use the normal Excel Export as it truncates at 65535 rows

I have added the following in Module1 VBA
Code:
Sub ExportCSV()
DoCmd.TransferText acExportDelim, , "R10 - Management Report", "O:\emd\Consumer Products\Category Management\CM Reports\R10 - Management Report.txt", True
End Sub

how on earth do I get the code to run in a macro
I have tried:
ACTION: RunCode
Function Name: ExportCSV
But it does not work, Am I missing something obvious?
 
For a Macro to run CODE, you need to declare that CODE as Function. Not Sub.

In a Standard Module add this code..
Code:
Public Function ExportCSV()
    DoCmd.TransferText acExportDelim, , "R10 - Management Report", "O:\emd\Consumer Products\Category Management\CM Reports\R10 - Management Report.txt", True
End Function
And use Macro to run, as you would normally do..
 
macro's only run FUNCTIONS (which IMNSHO is stupid to start with)
i.e.
Public Function Export

End Function

You can also "link" a crosstab in excel directly to any table or query in access if you choose the "external data source" option when creating the crosstab... No need to export the data :P
 
You two are my guardian angels at the moment. Wish I could get you both some festive cheer :D
 
macro's only run FUNCTIONS (which IMNSHO is stupid to start with)
i.e.
Public Function Export

End Function

You can also "link" a crosstab in excel directly to any table or query in access if you choose the "external data source" option when creating the crosstab... No need to export the data :P

You are blowing my brain, I get the jist but not the knowhow.
I'm guessing you are talking about my previous post, which I have to go back to or I will not get anything done again today :(
 
4 of you on the 14th and not a million miles away, hmmm
You really dont want me asking stupid questions over pigs in blankets even if my wallet if full :D.

Enjoy it guys, you deserve it.
 

Users who are viewing this thread

Back
Top Bottom