Hi All,
This is my first time trying to do anything with VBA so please be gentle :-). I've translated a macro which exports a file to a specific save location so I can use concatenate to save it with today's date in the same. Now I can't seem to assign this module to a button on my navigation panel. Would you mind kindly taking a look?
Private Sub Command58_Click()
Function Run_Macro()
On Error GoTo Run_Macro_Err
DoCmd.OutputTo acOutputQuery, "Query Union", "ExcelWorkbook(*.xlsx)", "S:\stevez\blahblah\Trade Processing Team\foreign exchange\FX Files\bbh_date.xlsx", True, "", , acExportQualityPrint
DoCmd.SetWarnings False
DoCmd.OpenQuery "AppendNonAgent", acViewNormal, acEdit
DoCmd.SetWarnings False
DoCmd.OpenQuery "AppendAgent", acViewNormal, acEdit
Run_Macro_Exit:
Exit Function
Run_Macro_Err:
MsgBox Error$
Resume Run_Macro_Exit
End Function
End Sub