Viewing Access Macro Code

purceld2

Registered User.
Local time
Today, 21:21
Joined
Dec 4, 2008
Messages
79
I have created a macro which runs fine. I now wish cut and paste the code into a module how can I view the code the macro code.

thanks in advance

Desmond
 
Depends on version, but in pre-2007 it's in Tools/Macro/Convert Macro to VBA code. That will create a standard module, from which you can cut/paste the code as desired.
 
Hello,

Thanks for your reply, I am using the following code but when i run the query, it only give me the file name but not the date; could you please help in this code.

'------------------------------------------------------------
' autoexec
'
'------------------------------------------------------------
Function autoexec()
On Error GoTo autoexec_Err
DoCmd.SetWarnings False
' ESSAIS_AISGRIEF Without Matching AB5KD023_PARTNO
DoCmd.OpenQuery "ESSAIS_AISGRIEF Without Matching AB5KD023_PARTNO", acNormal, acReadOnly
DoCmd.TransferSpreadsheet acExport, 8, "ESSAIS_AISGRIEF Without Matching AB5KD023_PARTNO", "L:\HEX\PLNG\Geometric\MBM Grief report\MBM grief report\MBM Griefs le_" & Format(Now, "DDMMMYYYY") & ".xls", True, ""
' 0G Toplevel Discrepancy Report
DoCmd.OpenQuery "0G Toplevel Discrepancy Report", acNormal, acReadOnly
DoCmd.TransferSpreadsheet acExport, 8, "0G Toplevel Discrepancy Report", "L:\HEX\PLNG\Geometric\Daily Reports - DB2\OG Toplevel Discrepancy Report\0G Toplevel Discrepancy Report_" & Format(Now, "DDMMMYYYYHHMM") & ".xls", True, ""
' Contcode Discrepency Report
DoCmd.OpenQuery "Contcode Discrepency Report", acNormal, acReadOnly
DoCmd.TransferSpreadsheet acExport, 8, "Contcode Discrepency Report", "L:\HEX\PLNG\Geometric\Daily Reports - DB2\Container Code Discrepency\Contcode Discrepency_" & Format(Now, "DDMMMYYYYHHMM") & ".xls", True, ""

DoCmd.Quit acSave

autoexec_Exit:
 

Users who are viewing this thread

Back
Top Bottom