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: